Struct LBFGSConfig
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§
§impl LBFGSConfig
impl LBFGSConfig
pub fn new() -> LBFGSConfig
pub fn new() -> LBFGSConfig
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"
§impl LBFGSConfig
impl LBFGSConfig
pub fn with_max_iter(self, max_iter: usize) -> LBFGSConfig
pub fn with_max_iter(self, max_iter: usize) -> LBFGSConfig
Sets the value for the field max_iter.
Maximal number of iterations per optimization step (default: 20)
- Defaults to
20
pub fn with_history_size(self, history_size: usize) -> LBFGSConfig
pub fn with_history_size(self, history_size: usize) -> LBFGSConfig
pub fn with_tolerance_grad(self, tolerance_grad: f64) -> LBFGSConfig
pub fn with_tolerance_grad(self, tolerance_grad: f64) -> LBFGSConfig
Sets the value for the field tolerance_grad.
Termination tolerance on first order optimality (default: 1e-7).
- Defaults to
1e-7
pub fn with_tolerance_change(self, tolerance_change: f64) -> LBFGSConfig
pub fn with_tolerance_change(self, tolerance_change: f64) -> LBFGSConfig
Sets the value for the field tolerance_change.
Termination tolerance on function value/parameter changes (default: 1e-9).
- Defaults to
1e-9
pub fn with_max_eval(self, max_eval: Option<usize>) -> LBFGSConfig
pub fn with_max_eval(self, max_eval: Option<usize>) -> LBFGSConfig
Sets the value for the field max_eval.
Maximal number of function evaluations per optimization step (default: max_iter * 1.25).
- Defaults to
"None"
pub fn with_line_search_fn(self, line_search_fn: LineSearchFn) -> LBFGSConfig
pub fn with_line_search_fn(self, line_search_fn: LineSearchFn) -> LBFGSConfig
Sets the value for the field line_search_fn.
Either ‘strong_wolfe’ or None (default: None).
- Defaults to
"LineSearchFn::None"
§impl LBFGSConfig
impl LBFGSConfig
pub fn init<B>(&self) -> LBFGS<B>where
B: AutodiffBackend,
pub fn init<B>(&self) -> LBFGS<B>where
B: AutodiffBackend,
Trait Implementations§
§impl Clone for LBFGSConfig
impl Clone for LBFGSConfig
§fn clone(&self) -> LBFGSConfig
fn clone(&self) -> LBFGSConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Config for LBFGSConfig
impl Config for LBFGSConfig
§impl Debug for LBFGSConfig
impl Debug for LBFGSConfig
§impl<'de> Deserialize<'de> for LBFGSConfig
impl<'de> Deserialize<'de> for LBFGSConfig
§fn deserialize<D>(
deserializer: D,
) -> Result<LBFGSConfig, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<LBFGSConfig, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for LBFGSConfig
impl Display for LBFGSConfig
§impl Serialize for LBFGSConfig
impl Serialize for LBFGSConfig
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl Freeze for LBFGSConfig
impl RefUnwindSafe for LBFGSConfig
impl Send for LBFGSConfig
impl Sync for LBFGSConfig
impl Unpin 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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more