pub struct CyclicLr { /* private fields */ }Expand description
Cyclic learning-rate scheduler with triangular policy.
Cycles the learning rate between base_lr and max_lr with a triangular
waveform defined by step_size_up (ascending half) and step_size_down
(descending half).
Implementations§
Source§impl CyclicLr
impl CyclicLr
Sourcepub fn new(
base_lr: f32,
max_lr: f32,
step_size_up: usize,
step_size_down: usize,
) -> Result<Self, OptimError>
pub fn new( base_lr: f32, max_lr: f32, step_size_up: usize, step_size_down: usize, ) -> Result<Self, OptimError>
Creates cyclic LR scheduler.
base_lr >= 0,max_lr >= base_lrstep_size_up > 0,step_size_down > 0
pub fn base_lr(&self) -> f32
pub fn max_lr(&self) -> f32
pub fn step_size_up(&self) -> usize
pub fn step_size_down(&self) -> usize
pub fn epoch(&self) -> usize
pub fn reset(&mut self)
pub fn step<O: LearningRate>( &mut self, optimizer: &mut O, ) -> Result<f32, OptimError>
Trait Implementations§
Source§impl LrScheduler for CyclicLr
impl LrScheduler for CyclicLr
impl StructuralPartialEq for CyclicLr
Auto Trait Implementations§
impl Freeze for CyclicLr
impl RefUnwindSafe for CyclicLr
impl Send for CyclicLr
impl Sync for CyclicLr
impl Unpin for CyclicLr
impl UnsafeUnpin for CyclicLr
impl UnwindSafe for CyclicLr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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