pub struct Exponential { /* private fields */ }Expand description
Exponential is a builder for Exponential Learning rate scheduler which allows for more flexible and readable construction.
It implements an exponential decay learning rate scheduler which continuously
decreases the learning rate after each epoch. This scheduler is useful for smoothing the training process
by gradually decreasing the step size of updates to the model’s parameters,
allowing for more precise convergence as training progresses. The rate of decay per epoch is
controlled by decay_rate raised to the power of the product of the epoch number and decay_factor.
Implementations§
Source§impl Exponential
impl Exponential
Sourcepub fn initial_lr(self, initial_lr: f32) -> Self
pub fn initial_lr(self, initial_lr: f32) -> Self
Sets the initial learning rate. This is the starting learning rate before any decay is applied.
§Parameters
initial_lr: The initial learning rate.
Sourcepub fn decay_rate(self, decay_rate: f32) -> Self
pub fn decay_rate(self, decay_rate: f32) -> Self
Sets the decay rate. This is the base for the exponential decay.
§Parameters
decay_rate: The decay rate.
Sourcepub fn decay_factor(self, decay_factor: f32) -> Self
pub fn decay_factor(self, decay_factor: f32) -> Self
Sets the decay factor. This controls how quickly the learning rate decreases. A smaller decay factor results in slower decay.
§Parameters
decay_factor: The decay factor.
Sourcepub fn build(self) -> Result<Box<dyn LearningRateScheduler>, NetworkError>
pub fn build(self) -> Result<Box<dyn LearningRateScheduler>, NetworkError>
Builds the ExponentialLRScheduler if all required fields are set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Exponential
impl RefUnwindSafe for Exponential
impl Send for Exponential
impl Sync for Exponential
impl Unpin for Exponential
impl UnsafeUnpin for Exponential
impl UnwindSafe for Exponential
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.