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"
Source§impl LBFGSConfig
impl LBFGSConfig
Sourcepub fn init<B: AutodiffBackend>(&self) -> LBFGS<B>
pub fn init<B: AutodiffBackend>(&self) -> LBFGS<B>
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.