Skip to main content

IActivationLayer

Struct IActivationLayer 

Source
pub struct IActivationLayer { /* private fields */ }
Expand description

IActivationLayer

An Activation layer in a network definition.

This layer applies a per-element activation function to its input.

The output has the same shape as the input.

The input is a shape tensor if the output is a shape tensor.

Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.

Implementations§

Source§

impl IActivationLayer

Source

pub fn setActivationType( self: Pin<&mut IActivationLayer>, type_: ActivationType, )

Set the type of activation to be performed.

On the DLA, the valid activation types are kRELU, kSIGMOID, kTANH, and kCLIP.

See [getActivationType()], ActivationType

Source

pub fn getActivationType(self: &IActivationLayer) -> ActivationType

Get the type of activation to be performed.

See [setActivationType()], ActivationType

Source

pub fn setAlpha(self: Pin<&mut IActivationLayer>, alpha: f32)

Set the alpha parameter (must be finite).

This parameter is used by the following activations: LeakyRelu, Elu, Selu, Softplus, Clip, HardSigmoid, ScaledTanh, ThresholdedRelu.

It is ignored by the other activations.

See [getAlpha()], setBeta()

Source

pub fn setBeta(self: Pin<&mut IActivationLayer>, beta: f32)

Set the beta parameter (must be finite).

This parameter is used by the following activations: Selu, Softplus, Clip, HardSigmoid, ScaledTanh.

It is ignored by the other activations.

See [getBeta()], setAlpha()

Source

pub fn getAlpha(self: &IActivationLayer) -> f32

Get the alpha parameter.

See [getBeta()], setAlpha()

Source

pub fn getBeta(self: &IActivationLayer) -> f32

Get the beta parameter.

See [getAlpha()], setBeta()

Trait Implementations§

Source§

impl AsLayer for IActivationLayer

Source§

fn as_layer(&self) -> &ILayer

Source§

fn as_layer_pin_mut(&mut self) -> Pin<&mut ILayer>

Source§

impl AsLayerTyped for IActivationLayer

Source§

const TYPE: LayerType = LayerType::kACTIVATION

Source§

impl AsRef<ILayer> for IActivationLayer

Source§

fn as_ref(self: &IActivationLayer) -> &ILayer

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl ExternType for IActivationLayer

Source§

type Id = (n, v, i, n, f, e, r, _1, (), I, A, c, t, i, v, a, t, i, o, n, L, a, y, e, r)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Opaque

Source§

impl MakeCppStorage for IActivationLayer

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut IActivationLayer

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut IActivationLayer)

Frees a C++ allocation which has not yet had a constructor called. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.