pub struct Lion {
pub learning_rate: LearningRate,
pub betas: (f64, f64),
pub weight_decay: f64,
/* private fields */
}Expand description
Lion, as MLX’s optimizers.Lion: the sign of an interpolated momentum, with optional
decoupled weight decay.
Fields§
§learning_rate: LearningRateThe learning rate.
betas: (f64, f64)Interpolation (b1) and momentum (b2) rates; MLX’s default (0.9, 0.99).
weight_decay: f64Decoupled weight decay.
Implementations§
Source§impl Lion
impl Lion
Sourcepub fn new(learning_rate: impl Into<LearningRate>) -> Self
pub fn new(learning_rate: impl Into<LearningRate>) -> Self
Lion with betas (0.9, 0.99) and no weight decay.
Sourcepub fn weight_decay(self, weight_decay: f64) -> Self
pub fn weight_decay(self, weight_decay: f64) -> Self
Sets the decoupled weight decay.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Lion
impl !UnwindSafe for Lion
impl Freeze for Lion
impl Send for Lion
impl Sync for Lion
impl Unpin for Lion
impl UnsafeUnpin for Lion
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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