Struct leaf::solvers::sgd::momentum::Momentum
[−]
[src]
pub struct Momentum<SolverB: IBackend + SolverOps<f32>> { /* fields omitted */ }
Stochastic Gradient Descent with Momentum.
See module description for more information.
Methods
impl<SolverB: IBackend + SolverOps<f32>> Momentum<SolverB>
[src]
fn new(backend: Rc<SolverB>) -> Momentum<SolverB>
Create a new SGD Momentum solver.
Should not be called directly. Use Solver::from_config instead.
Trait Implementations
impl<SolverB: Debug + IBackend + SolverOps<f32>> Debug for Momentum<SolverB>
[src]
impl<SolverB: IBackend + SolverOps<f32>, NetB: IBackend + LayerOps<f32> + 'static> ISolver<SolverB, NetB> for Momentum<SolverB>
[src]
fn init(&mut self, net: &Layer<NetB>)
Initialize the SGD Momentum solver, allocating memory for its history.
fn compute_update(
&mut self,
config: &SolverConfig,
net: &mut Layer<NetB>,
iter: usize
)
&mut self,
config: &SolverConfig,
net: &mut Layer<NetB>,
iter: usize
)
Update the weights of the net with part of the gradient. Read more
fn backend(&self) -> &SolverB
Returns the backend used by the solver.