Skip to main content

Activator

Trait Activator 

Source
pub trait Activator<T> {
    type Output;

    // Required method
    fn activate(&self, input: T) -> Self::Output;
}
Expand description

An Activator defines an interface for structural activation functions that can be applied onto various types.

Required Associated Types§

Required Methods§

Source

fn activate(&self, input: T) -> Self::Output

Applies the activation function to the input tensor.

Trait Implementations§

Source§

impl<X, Y> Activator<X> for Box<dyn Activator<X, Output = Y>>

Available on crate feature alloc only.
Source§

type Output = Y

Source§

fn activate(&self, rhs: X) -> Self::Output

Applies the activation function to the input tensor.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<X, Y> Activator<X> for Box<dyn Activator<X, Output = Y>>

Available on crate feature alloc only.
Source§

type Output = Y

Source§

fn activate(&self, rhs: X) -> Self::Output

Implementors§

Source§

impl<F, P, A, X, Y> Activator<X> for LayerBase<F, P>
where F: Activator<X, Output = Y>, P: RawParams<Elem = A>,

Source§

type Output = <F as Activator<X>>::Output

Source§

impl<T> Activator<T> for HeavySide

Source§

impl<T> Activator<T> for HyperbolicTangent
where T: TanhActivation,

Source§

impl<T> Activator<T> for Linear

Source§

impl<T> Activator<T> for ReLU
where T: ReLUActivation,

Source§

impl<T> Activator<T> for Sigmoid

Source§

impl<T> Activator<T> for Softmax

Source§

impl<X, Y, F> Activator<X> for F
where F: Fn(X) -> Y,