pub struct AdamParams {
pub learning_rate: f32,
pub beta1: f32,
pub beta2: f32,
pub epsilon: f32,
pub weight_decay: f32,
}Fields§
§learning_rate: f32Step size.
beta1: f32First-moment decay.
beta2: f32Second-moment decay.
epsilon: f32Denominator stabiliser.
weight_decay: f32Weight decay (coupled L2 for Adam, decoupled for AdamW).
Implementations§
Source§impl AdamParams
impl AdamParams
Sourcepub fn new(
learning_rate: f32,
beta1: f32,
beta2: f32,
epsilon: f32,
weight_decay: f32,
) -> Result<Self, GpuOptimError>
pub fn new( learning_rate: f32, beta1: f32, beta2: f32, epsilon: f32, weight_decay: f32, ) -> Result<Self, GpuOptimError>
Build a validated parameter set.
Returns GpuOptimError::InvalidState instead of panicking when a
value is outside its admissible range.
Trait Implementations§
Source§impl Clone for AdamParams
impl Clone for AdamParams
Source§fn clone(&self) -> AdamParams
fn clone(&self) -> AdamParams
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 moreimpl Copy for AdamParams
Source§impl Debug for AdamParams
impl Debug for AdamParams
Source§impl Default for AdamParams
impl Default for AdamParams
Source§impl PartialEq for AdamParams
impl PartialEq for AdamParams
impl StructuralPartialEq for AdamParams
Auto Trait Implementations§
impl Freeze for AdamParams
impl RefUnwindSafe for AdamParams
impl Send for AdamParams
impl Sync for AdamParams
impl Unpin for AdamParams
impl UnsafeUnpin for AdamParams
impl UnwindSafe for AdamParams
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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