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§
Required Methods§
Sourcefn step(&mut self) -> LearningRate
fn step(&mut self) -> LearningRate
Perform the scheduler step, potentially updating its state, and returning the effective learning rate.
Sourcefn to_record<B: Backend>(&self) -> Self::Record<B>
fn to_record<B: Backend>(&self) -> Self::Record<B>
Get the current state of the scheduler as a record.
Sourcefn load_record<B: Backend>(self, record: Self::Record<B>) -> Self
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.