pub struct LBFGSConfig {
pub max_iter: usize,
pub history_size: usize,
pub tolerance_grad: f64,
pub tolerance_change: f64,
pub max_eval: Option<usize>,
pub line_search_fn: LineSearchFn,
}Expand description
LBFGS Configuration.
Fields§
§max_iter: usizeMaximal number of iterations per optimization step (default: 20)
history_size: usizeUpdate history size (default: 100).
tolerance_grad: f64Termination tolerance on first order optimality (default: 1e-7).
tolerance_change: f64Termination tolerance on function value/parameter changes (default: 1e-9).
max_eval: Option<usize>Maximal number of function evaluations per optimization step (default: max_iter * 1.25).
line_search_fn: LineSearchFnEither ‘strong_wolfe’ or None (default: None).
Implementations§
Source§impl LBFGSConfig
impl LBFGSConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance of the config.
§Arguments
§Default Arguments
§max_iter
Maximal number of iterations per optimization step (default: 20)
- Defaults to
20
§history_size
Update history size (default: 100).
- Defaults to
100
§tolerance_grad
Termination tolerance on first order optimality (default: 1e-7).
- Defaults to
1e-7
§tolerance_change
Termination tolerance on function value/parameter changes (default: 1e-9).
- Defaults to
1e-9
§max_eval
Maximal number of function evaluations per optimization step (default: max_iter * 1.25).
- Defaults to
"None"
§line_search_fn
Either ‘strong_wolfe’ or None (default: None).
- Defaults to
"LineSearchFn::None"
Source§impl LBFGSConfig
impl LBFGSConfig
Sourcepub fn with_max_iter(self, max_iter: usize) -> Self
pub fn with_max_iter(self, max_iter: usize) -> Self
Sets the value for the field max_iter.
Maximal number of iterations per optimization step (default: 20)
- Defaults to
20
Sourcepub fn with_history_size(self, history_size: usize) -> Self
pub fn with_history_size(self, history_size: usize) -> Self
Sourcepub fn with_tolerance_grad(self, tolerance_grad: f64) -> Self
pub fn with_tolerance_grad(self, tolerance_grad: f64) -> Self
Sets the value for the field tolerance_grad.
Termination tolerance on first order optimality (default: 1e-7).
- Defaults to
1e-7
Sourcepub fn with_tolerance_change(self, tolerance_change: f64) -> Self
pub fn with_tolerance_change(self, tolerance_change: f64) -> Self
Sets the value for the field tolerance_change.
Termination tolerance on function value/parameter changes (default: 1e-9).
- Defaults to
1e-9
Sourcepub fn with_max_eval(self, max_eval: Option<usize>) -> Self
pub fn with_max_eval(self, max_eval: Option<usize>) -> Self
Sets the value for the field max_eval.
Maximal number of function evaluations per optimization step (default: max_iter * 1.25).
- Defaults to
"None"
Sourcepub fn with_line_search_fn(self, line_search_fn: LineSearchFn) -> Self
pub fn with_line_search_fn(self, line_search_fn: LineSearchFn) -> Self
Sets the value for the field line_search_fn.
Either ‘strong_wolfe’ or None (default: None).
- Defaults to
"LineSearchFn::None"
Trait Implementations§
Source§impl Clone for LBFGSConfig
impl Clone for LBFGSConfig
Source§impl Config for LBFGSConfig
impl Config for LBFGSConfig
Source§fn save<P>(&self, file: P) -> Result<(), Error>
fn save<P>(&self, file: P) -> Result<(), Error>
std only.Source§fn load<P>(file: P) -> Result<Self, ConfigError>
fn load<P>(file: P) -> Result<Self, ConfigError>
std only.Source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Source§impl Debug for LBFGSConfig
impl Debug for LBFGSConfig
Source§impl<'de> Deserialize<'de> for LBFGSConfig
impl<'de> Deserialize<'de> for LBFGSConfig
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for LBFGSConfig
impl Display for LBFGSConfig
Auto Trait Implementations§
impl Freeze for LBFGSConfig
impl RefUnwindSafe for LBFGSConfig
impl Send for LBFGSConfig
impl Sync for LBFGSConfig
impl Unpin for LBFGSConfig
impl UnsafeUnpin for LBFGSConfig
impl UnwindSafe for LBFGSConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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