pub trait ApplyGradient<Delta, T> {
type Output;
// Required methods
fn apply_gradient(&mut self, grad: &Delta, lr: T) -> Option<Self::Output>;
fn apply_gradient_with_decay(
&mut self,
grad: &Delta,
lr: T,
decay: T,
) -> Option<Self::Output>;
}Expand description
A trait declaring basic gradient-related routines for a neural network
Required Associated Types§
Required Methods§
fn apply_gradient(&mut self, grad: &Delta, lr: T) -> Option<Self::Output>
fn apply_gradient_with_decay( &mut self, grad: &Delta, lr: T, decay: T, ) -> Option<Self::Output>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".