pub struct RangerConfig {
pub radam: RAdamConfig,
pub alpha: f64,
pub k: usize,
}Expand description
Ranger optimizer configuration.
Ranger combines RAdam with Lookahead for improved training stability and generalization. It uses RAdam as the inner optimizer and applies Lookahead’s slow weights mechanism.
Reference: “Lookahead Optimizer: k steps forward, 1 step back” by Zhang et al. (2019)
Fields§
§radam: RAdamConfigRAdam configuration.
alpha: f64Lookahead alpha (interpolation coefficient).
k: usizeLookahead k (synchronization period).
Implementations§
Source§impl RangerConfig
impl RangerConfig
Sourcepub fn with_alpha(self, alpha: f64) -> Self
pub fn with_alpha(self, alpha: f64) -> Self
Set lookahead alpha.
Sourcepub fn with_weight_decay(self, weight_decay: f64) -> Self
pub fn with_weight_decay(self, weight_decay: f64) -> Self
Set weight decay.
Sourcepub fn with_beta1(self, beta1: f64) -> Self
pub fn with_beta1(self, beta1: f64) -> Self
Set beta1.
Sourcepub fn with_beta2(self, beta2: f64) -> Self
pub fn with_beta2(self, beta2: f64) -> Self
Set beta2.
Trait Implementations§
Source§impl Clone for RangerConfig
impl Clone for RangerConfig
Source§fn clone(&self) -> RangerConfig
fn clone(&self) -> RangerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RangerConfig
impl Debug for RangerConfig
Source§impl Default for RangerConfig
impl Default for RangerConfig
Source§impl<'de> Deserialize<'de> for RangerConfig
impl<'de> Deserialize<'de> for RangerConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RangerConfig
impl RefUnwindSafe for RangerConfig
impl Send for RangerConfig
impl Sync for RangerConfig
impl Unpin for RangerConfig
impl UnsafeUnpin for RangerConfig
impl UnwindSafe for RangerConfig
Blanket Implementations§
impl<T> Allocation for T
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> 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>
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