pub struct AdamConfig {
pub beta_1: f64,
pub beta_2: f64,
pub epsilon: f64,
pub weight_decay: Option<f64>,
}
Expand description
Configuration for Adam optimizer.
Fields§
§beta_1: f64
The coefficient used for computing running average of gradient.
beta_2: f64
The coefficient used for computing running average of squared gradient.
epsilon: f64
A value added to the denominator to improve numerical stability.
weight_decay: Option<f64>
L2 penalty.
Implementations§
source§impl AdamConfig
impl AdamConfig
source§impl AdamConfig
impl AdamConfig
sourcepub fn with_beta_1(self, beta_1: f64) -> Self
pub fn with_beta_1(self, beta_1: f64) -> Self
The coefficient used for computing running average of gradient.
sourcepub fn with_beta_2(self, beta_2: f64) -> Self
pub fn with_beta_2(self, beta_2: f64) -> Self
The coefficient used for computing running average of squared gradient.
sourcepub fn with_epsilon(self, epsilon: f64) -> Self
pub fn with_epsilon(self, epsilon: f64) -> Self
A value added to the denominator to improve numerical stability.
sourcepub fn with_weight_decay(self, weight_decay: Option<f64>) -> Self
pub fn with_weight_decay(self, weight_decay: Option<f64>) -> Self
Set the default value for the field.
source§impl AdamConfig
impl AdamConfig
Trait Implementations§
source§impl Clone for AdamConfig
impl Clone for AdamConfig
source§impl Config for AdamConfig
impl Config for AdamConfig
source§impl Debug for AdamConfig
impl Debug for AdamConfig
source§impl Default for AdamConfig
impl Default for AdamConfig
source§impl<'de> Deserialize<'de> for AdamConfig
impl<'de> Deserialize<'de> for AdamConfig
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
source§impl Display for AdamConfig
impl Display for AdamConfig
source§impl PartialEq for AdamConfig
impl PartialEq for AdamConfig
source§impl Serialize for AdamConfig
impl Serialize for AdamConfig
impl Copy for AdamConfig
impl StructuralPartialEq for AdamConfig
Auto Trait Implementations§
impl Freeze for AdamConfig
impl RefUnwindSafe for AdamConfig
impl Send for AdamConfig
impl Sync for AdamConfig
impl Unpin for AdamConfig
impl UnwindSafe for AdamConfig
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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