Trait burn::lr_scheduler::LrScheduler

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

    // Required methods
    fn step(&mut self) -> f64;
    fn to_record<B>(&self) -> Self::Record<B>
       where B: Backend;
    fn load_record<B>(self, record: Self::Record<B>) -> Self
       where B: Backend;
}
Expand description

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

Required Associated Types§

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

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

Required Methods§

fn step(&mut self) -> f64

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

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

Get the current state of the scheduler as a record.

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

Load the state of the scheduler as a record.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl LrScheduler for f64

§

type Record<B: Backend> = ()

§

fn step(&mut self) -> f64

§

fn to_record<B>(&self) -> <f64 as LrScheduler>::Record<B>
where B: Backend,

§

fn load_record<B>(self, _record: <f64 as LrScheduler>::Record<B>) -> f64
where B: Backend,

Implementors§