LrScheduler

Trait LrScheduler 

Source
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§

Source

fn step(&mut self) -> f64

Advance by one step and return the new learning rate.

Source

fn current_lr(&self) -> f64

Get the current learning rate without advancing.

Source

fn current_step(&self) -> u64

Get the current step count.

Source

fn reset(&mut self)

Reset the scheduler to step 0.

Source

fn set_step(&mut self, step: u64)

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

Implementors§