pub struct MultiStepLR<O: Optimizer> { /* private fields */ }Expand description
Multi-step learning rate scheduler
Implementations§
Trait Implementations§
Source§impl<O: Optimizer> LRScheduler for MultiStepLR<O>
impl<O: Optimizer> LRScheduler for MultiStepLR<O>
Source§fn step(&mut self) -> OptimizerResult<()>
fn step(&mut self) -> OptimizerResult<()>
Update learning rates based on current epoch/step
Source§fn get_last_lr(&self) -> &[f32]
fn get_last_lr(&self) -> &[f32]
Get current learning rates
Source§fn get_base_lrs(&self) -> &[f32]
fn get_base_lrs(&self) -> &[f32]
Get base learning rates
Source§fn get_last_epoch(&self) -> i32
fn get_last_epoch(&self) -> i32
Get current epoch/step count
Source§fn state_dict(&self) -> SchedulerState
fn state_dict(&self) -> SchedulerState
Get scheduler state for serialization
Source§fn load_state_dict(&mut self, state: SchedulerState) -> OptimizerResult<()>
fn load_state_dict(&mut self, state: SchedulerState) -> OptimizerResult<()>
Load scheduler state from serialization
Source§fn step_with_metric(&mut self, metric: Option<f32>) -> OptimizerResult<()>
fn step_with_metric(&mut self, metric: Option<f32>) -> OptimizerResult<()>
Update learning rates with optional metrics (for ReduceLROnPlateau)
Auto Trait Implementations§
impl<O> Freeze for MultiStepLR<O>where
O: Freeze,
impl<O> RefUnwindSafe for MultiStepLR<O>where
O: RefUnwindSafe,
impl<O> Send for MultiStepLR<O>where
O: Send,
impl<O> Sync for MultiStepLR<O>where
O: Sync,
impl<O> Unpin for MultiStepLR<O>where
O: Unpin,
impl<O> UnsafeUnpin for MultiStepLR<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for MultiStepLR<O>where
O: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more