pub struct LineSearch {
pub method: LineSearchMethod,
pub c1: f64,
pub c2: f64,
pub max_iterations: usize,
pub initial_step: f64,
pub step_decay: f64,
}Expand description
Line search methods for optimization algorithms
Fields§
§method: LineSearchMethod§c1: f64§c2: f64§max_iterations: usize§initial_step: f64§step_decay: f64Implementations§
Source§impl LineSearch
impl LineSearch
Sourcepub fn strong_wolfe(c1: f64, c2: f64) -> Self
pub fn strong_wolfe(c1: f64, c2: f64) -> Self
Create strong Wolfe line search
Sourcepub fn backtracking(c1: f64) -> Self
pub fn backtracking(c1: f64) -> Self
Create backtracking line search
Sourcepub fn search<F, G>(
&self,
f: F,
grad_f: G,
x: &ArrayView1<'_, f64>,
direction: &ArrayView1<'_, f64>,
f_x: f64,
grad_x: &ArrayView1<'_, f64>,
) -> UtilsResult<f64>
pub fn search<F, G>( &self, f: F, grad_f: G, x: &ArrayView1<'_, f64>, direction: &ArrayView1<'_, f64>, f_x: f64, grad_x: &ArrayView1<'_, f64>, ) -> UtilsResult<f64>
Perform line search to find appropriate step size
Trait Implementations§
Source§impl Clone for LineSearch
impl Clone for LineSearch
Source§fn clone(&self) -> LineSearch
fn clone(&self) -> LineSearch
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 LineSearch
impl RefUnwindSafe for LineSearch
impl Send for LineSearch
impl Sync for LineSearch
impl Unpin for LineSearch
impl UnwindSafe for LineSearch
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