pub struct ScheduleFreeConfig {
pub lr: f64,
pub beta1: f64,
pub beta2: f64,
pub weight_decay: f64,
pub eps: f64,
pub gamma: f64,
pub warmup_steps: usize,
pub grad_clip: Option<f64>,
pub grad_clip_mode: GradClipMode,
}Expand description
Configuration for schedule-free optimizers.
Fields§
§lr: f64Learning rate (constant, no schedule needed!)
beta1: f64Beta1 for first moment (default: 0.9)
beta2: f64Beta2 for second moment (default: 0.999)
weight_decay: f64Weight decay coefficient (default: 0.01)
eps: f64Epsilon for numerical stability (default: 1e-8)
gamma: f64Averaging coefficient γ for evaluation sequence (default: 0.95) Higher values = more smoothing, better generalization
warmup_steps: usizeNumber of warmup steps (default: 0) During warmup, gamma increases linearly from 0 to target value
grad_clip: Option<f64>Gradient clipping threshold (None = no clipping)
grad_clip_mode: GradClipModeGradient clipping mode
Implementations§
Source§impl ScheduleFreeConfig
impl ScheduleFreeConfig
Sourcepub fn with_beta1(self, beta1: f64) -> Self
pub fn with_beta1(self, beta1: f64) -> Self
Set beta1 (builder pattern).
Sourcepub fn with_beta2(self, beta2: f64) -> Self
pub fn with_beta2(self, beta2: f64) -> Self
Set beta2 (builder pattern).
Sourcepub fn with_weight_decay(self, weight_decay: f64) -> Self
pub fn with_weight_decay(self, weight_decay: f64) -> Self
Set weight decay (builder pattern).
Sourcepub fn with_gamma(self, gamma: f64) -> Self
pub fn with_gamma(self, gamma: f64) -> Self
Set gamma (averaging coefficient) (builder pattern).
Sourcepub fn with_warmup_steps(self, steps: usize) -> Self
pub fn with_warmup_steps(self, steps: usize) -> Self
Set warmup steps (builder pattern).
Sourcepub fn with_grad_clip(self, threshold: f64, mode: GradClipMode) -> Self
pub fn with_grad_clip(self, threshold: f64, mode: GradClipMode) -> Self
Set gradient clipping (builder pattern).
Trait Implementations§
Source§impl Clone for ScheduleFreeConfig
impl Clone for ScheduleFreeConfig
Source§fn clone(&self) -> ScheduleFreeConfig
fn clone(&self) -> ScheduleFreeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScheduleFreeConfig
impl Debug for ScheduleFreeConfig
Source§impl Default for ScheduleFreeConfig
impl Default for ScheduleFreeConfig
Source§impl<'de> Deserialize<'de> for ScheduleFreeConfig
impl<'de> Deserialize<'de> for ScheduleFreeConfig
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>,
Auto Trait Implementations§
impl Freeze for ScheduleFreeConfig
impl RefUnwindSafe for ScheduleFreeConfig
impl Send for ScheduleFreeConfig
impl Sync for ScheduleFreeConfig
impl Unpin for ScheduleFreeConfig
impl UnwindSafe for ScheduleFreeConfig
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
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>
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