pub trait LayerExt<S, D>: Layer<S, D>{
// Provided methods
fn set_params(&mut self, params: ParamsBase<S, D>) { ... }
fn backward<X, Y, Z, Dt>(
&mut self,
input: X,
error: Y,
gamma: Self::Elem,
) -> Result<Z>
where S: Data,
Self: ActivatorGradient<X, Input = Y, Output = Z, Delta = Dt>,
Self::Elem: Clone,
ParamsBase<S, D>: Backward<X, Dt, Elem = Self::Elem, Output = Z> { ... }
fn forward<X, Y>(&self, input: &X) -> Result<Y>
where Y: NdTensor<S::Elem, D, Repr = S>,
ParamsBase<S, D>: Forward<X, Output = Y>,
Self: Activator<Y, Output = Y> { ... }
}Expand description
Provided Methods§
Sourcefn set_params(&mut self, params: ParamsBase<S, D>)
fn set_params(&mut self, params: ParamsBase<S, D>)
update the layer parameters
Sourcefn backward<X, Y, Z, Dt>(
&mut self,
input: X,
error: Y,
gamma: Self::Elem,
) -> Result<Z>where
S: Data,
Self: ActivatorGradient<X, Input = Y, Output = Z, Delta = Dt>,
Self::Elem: Clone,
ParamsBase<S, D>: Backward<X, Dt, Elem = Self::Elem, Output = Z>,
fn backward<X, Y, Z, Dt>(
&mut self,
input: X,
error: Y,
gamma: Self::Elem,
) -> Result<Z>where
S: Data,
Self: ActivatorGradient<X, Input = Y, Output = Z, Delta = Dt>,
Self::Elem: Clone,
ParamsBase<S, D>: Backward<X, Dt, Elem = Self::Elem, Output = Z>,
backward propagate error 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.