pub struct ExponentialDecayLR { /* private fields */ }Available on crate feature
alloc only.Expand description
Multiplicative exponential decay: lr = initial_lr * gamma^step.
The rate is floored at 1e-8 to prevent numerical underflow that would
effectively freeze learning. For a half-life of h steps, set
gamma = 0.5^(1/h).
§Example
ⓘ
use irithyll::ensemble::lr_schedule::{LRScheduler, ExponentialDecayLR};
let mut sched = ExponentialDecayLR::new(1.0, 0.9);
assert!(crate::math::abs((sched.learning_rate(0, 0.0) - 1.0)) < 1e-12);
assert!(crate::math::abs((sched.learning_rate(1, 0.0) - 0.9)) < 1e-12);
assert!(crate::math::abs((sched.learning_rate(2, 0.0) - 0.81)) < 1e-12);Implementations§
Trait Implementations§
Source§impl Clone for ExponentialDecayLR
impl Clone for ExponentialDecayLR
Source§fn clone(&self) -> ExponentialDecayLR
fn clone(&self) -> ExponentialDecayLR
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExponentialDecayLR
impl Debug for ExponentialDecayLR
Source§impl LRScheduler for ExponentialDecayLR
impl LRScheduler for ExponentialDecayLR
Auto Trait Implementations§
impl Freeze for ExponentialDecayLR
impl RefUnwindSafe for ExponentialDecayLR
impl Send for ExponentialDecayLR
impl Sync for ExponentialDecayLR
impl Unpin for ExponentialDecayLR
impl UnsafeUnpin for ExponentialDecayLR
impl UnwindSafe for ExponentialDecayLR
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