LrScheduler

Trait LrScheduler 

pub trait LrScheduler {
    // Required methods
    fn step(&mut self) -> f64;
    fn current_lr(&self) -> f64;
    fn current_step(&self) -> u64;
    fn reset(&mut self);
    fn set_step(&mut self, step: u64);
}
Expand description

Trait for learning rate schedulers.

Each call to step() advances the internal counter and returns the new LR.

Required Methods§

fn step(&mut self) -> f64

Advance by one step and return the new learning rate.

fn current_lr(&self) -> f64

Get the current learning rate without advancing.

fn current_step(&self) -> u64

Get the current step count.

fn reset(&mut self)

Reset the scheduler to step 0.

fn set_step(&mut self, step: u64)

Set the internal step counter to a specific value (for checkpoint restore).

Implementors§