pub struct ProdigyConfig {
pub d0: f64,
pub d_coef: f64,
pub lr: f64,
pub beta1: f64,
pub beta2: f64,
pub eps: f64,
pub weight_decay: f64,
pub grad_clip: Option<f64>,
pub grad_clip_mode: GradClipMode,
pub bias_correction: bool,
pub d_growth_rate: f64,
}Expand description
Configuration for Prodigy optimizer
Fields§
§d0: f64Initial D estimate (default: 1e-6) D represents the distance scale from initialization
d_coef: f64Coefficient for D adaptation (default: 1.0) Controls how aggressively D is adapted
lr: f64Learning rate (default: 1.0) Note: Prodigy is relatively insensitive to this value
beta1: f64First moment decay rate (default: 0.9)
beta2: f64Second moment decay rate (default: 0.999)
eps: f64Small constant for numerical stability (default: 1e-8)
weight_decay: f64Weight decay coefficient (default: 0.0) Applied as decoupled weight decay (like AdamW)
grad_clip: Option<f64>Gradient clipping threshold (optional)
grad_clip_mode: GradClipModeGradient clipping mode
bias_correction: boolWhether to use bias correction (default: true)
d_growth_rate: f64Growth rate for D (default: infinity, meaning no limit)
Implementations§
Source§impl ProdigyConfig
impl ProdigyConfig
Sourcepub fn with_d_coef(self, d_coef: f64) -> Self
pub fn with_d_coef(self, d_coef: f64) -> Self
Set D coefficient
Sourcepub fn with_beta1(self, beta1: f64) -> Self
pub fn with_beta1(self, beta1: f64) -> Self
Set beta1 (first moment decay)
Sourcepub fn with_beta2(self, beta2: f64) -> Self
pub fn with_beta2(self, beta2: f64) -> Self
Set beta2 (second moment decay)
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_grad_clip(self, grad_clip: f64) -> Self
pub fn with_grad_clip(self, grad_clip: f64) -> Self
Set gradient clipping
Sourcepub fn with_grad_clip_mode(self, mode: GradClipMode) -> Self
pub fn with_grad_clip_mode(self, mode: GradClipMode) -> Self
Set gradient clipping mode
Sourcepub fn with_bias_correction(self, bias_correction: bool) -> Self
pub fn with_bias_correction(self, bias_correction: bool) -> Self
Enable or disable bias correction
Sourcepub fn with_d_growth_rate(self, rate: f64) -> Self
pub fn with_d_growth_rate(self, rate: f64) -> Self
Set D growth rate limit
Trait Implementations§
Source§impl Clone for ProdigyConfig
impl Clone for ProdigyConfig
Source§fn clone(&self) -> ProdigyConfig
fn clone(&self) -> ProdigyConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProdigyConfig
impl Debug for ProdigyConfig
Source§impl Default for ProdigyConfig
impl Default for ProdigyConfig
Source§impl<'de> Deserialize<'de> for ProdigyConfig
impl<'de> Deserialize<'de> for ProdigyConfig
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 ProdigyConfig
impl RefUnwindSafe for ProdigyConfig
impl Send for ProdigyConfig
impl Sync for ProdigyConfig
impl Unpin for ProdigyConfig
impl UnsafeUnpin for ProdigyConfig
impl UnwindSafe for ProdigyConfig
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