pub trait CanUpdateWithGradients {
    fn update<G: GradientProvider>(&mut self, grads: &mut G);
}
Expand description

Represents something that can be updated with GradientProvider.

Most implementations of this trait will have sub structs that also implement CanUpdateWithGradients.

For example the Linear model just calls update on its weight & bias:

impl<const I: usize, const O: usize> CanUpdateWithGradients for Linear<I, O> {
    fn update<G: GradientProvider>(&mut self, grads: &mut G) {
        self.weight.update(grads);
        self.bias.update(grads);
    }
}

Required Methods

Implementations on Foreign Types

Implementors