pub struct MultiStepLR { /* private fields */ }Expand description
Multi-step decay: multiply lr by gamma at each milestone.
lr = base_lr * gamma^(number_of_milestones_passed)
ⓘ
let sched = MultiStepLR::new(0.1, &[30, 60, 90], 0.1);
assert!((sched.lr(0) - 0.1).abs() < 1e-10);
assert!((sched.lr(30) - 0.01).abs() < 1e-10);
assert!((sched.lr(60) - 0.001).abs() < 1e-10);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiStepLR
impl RefUnwindSafe for MultiStepLR
impl Send for MultiStepLR
impl Sync for MultiStepLR
impl Unpin for MultiStepLR
impl UnsafeUnpin for MultiStepLR
impl UnwindSafe for MultiStepLR
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