Trait Layer

Source
pub trait Layer<S, D>
where D: Dimension, S: RawData<Elem = Self::Elem>,
{ 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§

Source

type Elem

the type of element used within the layer; typically a floating-point variant like f32 or f64.

Source

type Rho: Activator<Self::Elem>

The type of activator used by the layer; the type must implement ActivatorGradient

Required Methods§

Source

fn rho(&self) -> &Self::Rho

Source

fn params(&self) -> &ParamsBase<S, D>

returns an immutable reference to the parameters of the layer

Source

fn params_mut(&mut self) -> &mut ParamsBase<S, D>

returns a mutable reference to the parameters of the layer

Implementors§

Source§

impl<A, F, S, D> Layer<S, D> for LayerBase<F, S, D>
where F: Activator<A, Output = A>, D: Dimension, S: RawData<Elem = A>,

Source§

type Elem = A

Source§

type Rho = F