pub struct ConvergenceCriteria {
pub tolerance: f64,
pub gradient_tolerance: f64,
pub parameter_tolerance: f64,
pub max_iterations: usize,
pub min_iterations: usize,
pub function_tolerance: f64,
pub patience: usize,
}Expand description
Convergence criteria for optimization algorithms
Fields§
§tolerance: f64§gradient_tolerance: f64§parameter_tolerance: f64§max_iterations: usize§min_iterations: usize§function_tolerance: f64§patience: usizeImplementations§
Source§impl ConvergenceCriteria
impl ConvergenceCriteria
Sourcepub fn with_tolerance(self, tol: f64) -> Self
pub fn with_tolerance(self, tol: f64) -> Self
Set gradient tolerance
Sourcepub fn with_gradient_tolerance(self, tol: f64) -> Self
pub fn with_gradient_tolerance(self, tol: f64) -> Self
Set gradient tolerance
Sourcepub fn with_parameter_tolerance(self, tol: f64) -> Self
pub fn with_parameter_tolerance(self, tol: f64) -> Self
Set parameter tolerance
Sourcepub fn with_max_iterations(self, max_iter: usize) -> Self
pub fn with_max_iterations(self, max_iter: usize) -> Self
Set maximum iterations
Sourcepub fn with_min_iterations(self, min_iter: usize) -> Self
pub fn with_min_iterations(self, min_iter: usize) -> Self
Set minimum iterations
Sourcepub fn with_function_tolerance(self, tol: f64) -> Self
pub fn with_function_tolerance(self, tol: f64) -> Self
Set function tolerance
Sourcepub fn with_patience(self, patience: usize) -> Self
pub fn with_patience(self, patience: usize) -> Self
Set patience for early stopping
Sourcepub fn is_converged(
&self,
iteration: usize,
current_f: f64,
previous_f: Option<f64>,
gradient: Option<&ArrayView1<'_, f64>>,
parameter_change: Option<f64>,
no_improvement_count: usize,
) -> ConvergenceStatus
pub fn is_converged( &self, iteration: usize, current_f: f64, previous_f: Option<f64>, gradient: Option<&ArrayView1<'_, f64>>, parameter_change: Option<f64>, no_improvement_count: usize, ) -> ConvergenceStatus
Check if convergence is achieved
Trait Implementations§
Source§impl Clone for ConvergenceCriteria
impl Clone for ConvergenceCriteria
Source§fn clone(&self) -> ConvergenceCriteria
fn clone(&self) -> ConvergenceCriteria
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 ConvergenceCriteria
impl Debug for ConvergenceCriteria
Auto Trait Implementations§
impl Freeze for ConvergenceCriteria
impl RefUnwindSafe for ConvergenceCriteria
impl Send for ConvergenceCriteria
impl Sync for ConvergenceCriteria
impl Unpin for ConvergenceCriteria
impl UnwindSafe for ConvergenceCriteria
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