pub struct AdaMaxPlusConfig {
pub learning_rate: f32,
pub betas: (f32, f32),
pub epsilon: f32,
pub weight_decay: f32,
pub adaptive_momentum: bool,
pub momentum_adaptation_strength: f32,
pub warmup_steps: usize,
pub variance_tracking: bool,
pub bias_correction_factor: f32,
pub outlier_threshold: f32,
}Expand description
Configuration for AdaMax+ optimizer
Fields§
§learning_rate: f32Learning rate
betas: (f32, f32)Exponential decay rates for moment estimates (β₁, β₂)
epsilon: f32Small constant for numerical stability
weight_decay: f32Weight decay (L2 regularization)
adaptive_momentum: boolEnable adaptive momentum scheduling
momentum_adaptation_strength: f32Momentum adaptation strength
warmup_steps: usizeNumber of warm-up steps
variance_tracking: boolEnable variance tracking for momentum adaptation
bias_correction_factor: f32Bias correction improvement factor
outlier_threshold: f32Outlier handling threshold for infinity norm
Implementations§
Source§impl AdaMaxPlusConfig
impl AdaMaxPlusConfig
Sourcepub fn learning_rate(self, lr: f32) -> Self
pub fn learning_rate(self, lr: f32) -> Self
Set learning rate
Sourcepub fn weight_decay(self, wd: f32) -> Self
pub fn weight_decay(self, wd: f32) -> Self
Set weight decay
Sourcepub fn enable_adaptive_momentum(self, enabled: bool) -> Self
pub fn enable_adaptive_momentum(self, enabled: bool) -> Self
Enable/disable adaptive momentum
Sourcepub fn momentum_adaptation_strength(self, strength: f32) -> Self
pub fn momentum_adaptation_strength(self, strength: f32) -> Self
Set momentum adaptation strength
Sourcepub fn warmup_steps(self, steps: usize) -> Self
pub fn warmup_steps(self, steps: usize) -> Self
Set warmup steps
Sourcepub fn variance_tracking(self, enabled: bool) -> Self
pub fn variance_tracking(self, enabled: bool) -> Self
Enable/disable variance tracking
Sourcepub fn bias_correction_factor(self, factor: f32) -> Self
pub fn bias_correction_factor(self, factor: f32) -> Self
Set bias correction factor
Sourcepub fn outlier_threshold(self, threshold: f32) -> Self
pub fn outlier_threshold(self, threshold: f32) -> Self
Set outlier threshold
Trait Implementations§
Source§impl Clone for AdaMaxPlusConfig
impl Clone for AdaMaxPlusConfig
Source§fn clone(&self) -> AdaMaxPlusConfig
fn clone(&self) -> AdaMaxPlusConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 AdaMaxPlusConfig
impl Debug for AdaMaxPlusConfig
Source§impl Default for AdaMaxPlusConfig
impl Default for AdaMaxPlusConfig
Source§impl<'de> Deserialize<'de> for AdaMaxPlusConfig
impl<'de> Deserialize<'de> for AdaMaxPlusConfig
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 AdaMaxPlusConfig
impl RefUnwindSafe for AdaMaxPlusConfig
impl Send for AdaMaxPlusConfig
impl Sync for AdaMaxPlusConfig
impl Unpin for AdaMaxPlusConfig
impl UnwindSafe for AdaMaxPlusConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> ConfigSerializable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
Source§fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
fn save_to_file(&self, path: &Path) -> Result<(), TrustformersError>
Save to file
Source§fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
fn load_from_file(path: &Path) -> Result<Self, TrustformersError>where
Self: Sized,
Load from file
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