pub struct LbfgsState {
pub lr: f64,
pub m: usize,
pub s_history: Vec<Vec<f64>>,
pub y_history: Vec<Vec<f64>>,
pub prev_params: Option<Vec<f64>>,
pub prev_grad: Option<Vec<f64>>,
}Expand description
L-BFGS optimizer state.
Limited-memory Broyden-Fletcher-Goldfarb-Shanno quasi-Newton method.
Maintains a history of m most recent (s, y) pairs to approximate
the inverse Hessian without storing it explicitly.
Fields§
§lr: f64§m: usizeHistory size (default 10)
s_history: Vec<Vec<f64>>Parameter differences: s_k = params_{k+1} - params_k
y_history: Vec<Vec<f64>>Gradient differences: y_k = grad_{k+1} - grad_k
prev_params: Option<Vec<f64>>§prev_grad: Option<Vec<f64>>Implementations§
Auto Trait Implementations§
impl Freeze for LbfgsState
impl RefUnwindSafe for LbfgsState
impl Send for LbfgsState
impl Sync for LbfgsState
impl Unpin for LbfgsState
impl UnsafeUnpin for LbfgsState
impl UnwindSafe for LbfgsState
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> 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