pub struct OptimizationHistory {
pub function_values: VecDeque<f64>,
pub gradient_norms: VecDeque<f64>,
pub parameter_changes: VecDeque<f64>,
pub step_sizes: VecDeque<f64>,
pub max_history_size: usize,
}Expand description
History tracking for optimization algorithms
Fields§
§function_values: VecDeque<f64>§gradient_norms: VecDeque<f64>§parameter_changes: VecDeque<f64>§step_sizes: VecDeque<f64>§max_history_size: usizeImplementations§
Source§impl OptimizationHistory
impl OptimizationHistory
Sourcepub fn add_function_value(&mut self, value: f64)
pub fn add_function_value(&mut self, value: f64)
Add function value to history
Sourcepub fn add_gradient_norm(&mut self, norm: f64)
pub fn add_gradient_norm(&mut self, norm: f64)
Add gradient norm to history
Sourcepub fn add_parameter_change(&mut self, change: f64)
pub fn add_parameter_change(&mut self, change: f64)
Add parameter change to history
Sourcepub fn add_step_size(&mut self, step: f64)
pub fn add_step_size(&mut self, step: f64)
Add step size to history
Sourcepub fn recent_function_values(&self, n: usize) -> Vec<f64>
pub fn recent_function_values(&self, n: usize) -> Vec<f64>
Get recent function values
Sourcepub fn has_improvement_trend(&self, window_size: usize) -> bool
pub fn has_improvement_trend(&self, window_size: usize) -> bool
Check for improvement trend
Sourcepub fn average_improvement_rate(&self, window_size: usize) -> Option<f64>
pub fn average_improvement_rate(&self, window_size: usize) -> Option<f64>
Get average improvement rate
Trait Implementations§
Source§impl Clone for OptimizationHistory
impl Clone for OptimizationHistory
Source§fn clone(&self) -> OptimizationHistory
fn clone(&self) -> OptimizationHistory
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 moreAuto Trait Implementations§
impl Freeze for OptimizationHistory
impl RefUnwindSafe for OptimizationHistory
impl Send for OptimizationHistory
impl Sync for OptimizationHistory
impl Unpin for OptimizationHistory
impl UnwindSafe for OptimizationHistory
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