pub trait Layer<S, D>{
type Elem;
type Rho: Activator<Self::Elem>;
// Required methods
fn rho(&self) -> &Self::Rho;
fn params(&self) -> &ParamsBase<S, D>;
fn params_mut(&mut self) -> &mut ParamsBase<S, D>;
}Expand description
A generic trait defining the composition of a layer within a neural network.
Required Associated Types§
Sourcetype Rho: Activator<Self::Elem>
type Rho: Activator<Self::Elem>
The type of activator used by the layer; the type must implement ActivatorGradient
Required Methods§
fn rho(&self) -> &Self::Rho
Sourcefn params(&self) -> &ParamsBase<S, D>
fn params(&self) -> &ParamsBase<S, D>
returns an immutable reference to the parameters of the layer
Sourcefn params_mut(&mut self) -> &mut ParamsBase<S, D>
fn params_mut(&mut self) -> &mut ParamsBase<S, D>
returns a mutable reference to the parameters of the layer