RawLayer

Trait RawLayer 

Source
pub trait RawLayer<F, A>
where F: Activator<A>, Self::Params<A>: RawParams<Elem = A>,
{ type Params<_T>; // Required methods fn rho(&self) -> &F; fn params(&self) -> &Self::Params<A>; // Provided method fn forward<X, Y, Z>(&self, input: &X) -> Z where F: Activator<Y, Output = Z>, Self::Params<A>: Forward<X, Output = Y> { ... } }
Expand description

The RawLayer trait establishes a common interface for all layers within a given model. Implementors will need to define the type of parameters they utilize, as well as provide methods to access both the activation function and the parameters of the layer.

Required Associated Types§

Source

type Params<_T>

Required Methods§

Source

fn rho(&self) -> &F

the activation function of the layer

Source

fn params(&self) -> &Self::Params<A>

returns an immutable reference to the parameters of the layer

Provided Methods§

Source

fn forward<X, Y, Z>(&self, input: &X) -> Z
where F: Activator<Y, Output = Z>, Self::Params<A>: Forward<X, Output = Y>,

complete a forward pass through the layer

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F, P, A> RawLayer<F, A> for LayerBase<F, P>
where F: Activator<A>, P: RawParams<Elem = A>,

Source§

type Params<_T> = P