pub enum LrSchedule {
Constant(f32),
Step {
base: f32,
step_size: usize,
gamma: f32,
},
Cosine {
base: f32,
min: f32,
total: usize,
},
Warmup {
base: f32,
warmup: usize,
},
WarmupCosine {
base: f32,
min: f32,
warmup: usize,
total: usize,
},
}Expand description
Common learning-rate schedules.
Variants§
Constant(f32)
Fixed learning rate.
Step
Multiply base by gamma every step_size steps (staircase).
Cosine
Cosine decay from base to min over total steps (then holds min).
Warmup
Linear warmup from 0 to base over warmup steps, then holds base.
WarmupCosine
Linear warmup to base over warmup, then cosine decay to min by
total — the standard transformer schedule.
Implementations§
Trait Implementations§
Source§impl Clone for LrSchedule
impl Clone for LrSchedule
Source§fn clone(&self) -> LrSchedule
fn clone(&self) -> LrSchedule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LrSchedule
Source§impl Debug for LrSchedule
impl Debug for LrSchedule
Source§impl PartialEq for LrSchedule
impl PartialEq for LrSchedule
impl StructuralPartialEq for LrSchedule
Auto Trait Implementations§
impl Freeze for LrSchedule
impl RefUnwindSafe for LrSchedule
impl Send for LrSchedule
impl Sync for LrSchedule
impl Unpin for LrSchedule
impl UnsafeUnpin for LrSchedule
impl UnwindSafe for LrSchedule
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