pub struct ConstantLR { /* private fields */ }Available on crate feature
alloc only.Expand description
Always returns the same learning rate.
This is the simplest scheduler and reproduces the behaviour of a plain
fixed-rate ensemble. It exists so that code paths expecting a dyn LRScheduler can use a constant rate without special-casing.
§Example
ⓘ
use irithyll::ensemble::lr_schedule::{LRScheduler, ConstantLR};
let mut sched = ConstantLR::new(0.05);
assert!(crate::math::abs((sched.learning_rate(0, 1.0) - 0.05)) < f64::EPSILON);
assert!(crate::math::abs((sched.learning_rate(1000, 0.1) - 0.05)) < f64::EPSILON);Implementations§
Trait Implementations§
Source§impl Clone for ConstantLR
impl Clone for ConstantLR
Source§fn clone(&self) -> ConstantLR
fn clone(&self) -> ConstantLR
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 ConstantLR
impl Debug for ConstantLR
Source§impl LRScheduler for ConstantLR
impl LRScheduler for ConstantLR
Auto Trait Implementations§
impl Freeze for ConstantLR
impl RefUnwindSafe for ConstantLR
impl Send for ConstantLR
impl Sync for ConstantLR
impl Unpin for ConstantLR
impl UnsafeUnpin for ConstantLR
impl UnwindSafe for ConstantLR
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