Trait burn::lr_scheduler::LrScheduler

pub trait LrScheduler<B>: Send + Sync
where B: Backend,
{ type Record: Record<B>; // Required methods fn step(&mut self) -> f64; fn to_record(&self) -> Self::Record; fn load_record(self, record: Self::Record) -> Self; }
Expand description

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

Required Associated Types§

type Record: 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(&self) -> Self::Record

Get the current state of the scheduler as a record.

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

Load the state of the scheduler as a record.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<B> LrScheduler<B> for f64
where B: Backend,

§

type Record = ()

§

fn step(&mut self) -> f64

§

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

§

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

Implementors§

§

impl<B> LrScheduler<B> for ConstantLr
where B: Backend,

§

type Record = ()

§

impl<B> LrScheduler<B> for CosineAnnealingLrScheduler
where B: Backend,

§

type Record = (f64, f64, f64, usize, usize)

§

impl<B> LrScheduler<B> for ExponentialLrScheduler
where B: Backend,

§

type Record = (f64, f64)

§

impl<B> LrScheduler<B> for LinearLrScheduler
where B: Backend,

§

type Record = (f64, f64, usize)

§

impl<B> LrScheduler<B> for NoamLrScheduler
where B: Backend,