Trait LrScheduler

Source
pub trait LrScheduler: Send + Sync {
    type Record<B: Backend>: Record<B>;

    // Required methods
    fn step(&mut self) -> LearningRate;
    fn to_record<B: Backend>(&self) -> Self::Record<B>;
    fn load_record<B: Backend>(self, record: Self::Record<B>) -> Self;
}
Available on crate feature std only.
Expand description

Learning rate scheduler defines how the learning rate will evolve during training.

Required Associated Types§

Source

type Record<B: Backend>: Record<B>

Scheduler associative type to be used when saving and loading the state.

Required Methods§

Source

fn step(&mut self) -> LearningRate

Perform the scheduler step, potentially updating its state, and returning the effective learning rate.

Source

fn to_record<B: Backend>(&self) -> Self::Record<B>

Get the current state of the scheduler as a record.

Source

fn load_record<B: Backend>(self, record: Self::Record<B>) -> Self

Load the state of the scheduler as a record.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§