pub struct Adam<D: Device> { /* private fields */ }Implementations§
Trait Implementations§
Source§impl<D: Device> Optimizer for Adam<D>
impl<D: Device> Optimizer for Adam<D>
Source§fn step(&mut self, grads: &GradStore<Self::Device>) -> Result<()>
fn step(&mut self, grads: &GradStore<Self::Device>) -> Result<()>
m = β₁·m + (1-β₁)·g
v = β₂·v + (1-β₂)·g²
m̂ = m / (1-β₁ᵗ) v̂ = v / (1-β₂ᵗ)
param -= lr * m̂ / (√v̂ + ε)type Device = D
fn get_lr(&self) -> f64
fn set_lr(&mut self, lr: f64)
fn state_dict(&self) -> Result<LumaPack<Self::Device>>
fn load_state_dict(&mut self, pack: &LumaPack<Self::Device>) -> Result<()>
Auto Trait Implementations§
impl<D> Freeze for Adam<D>
impl<D> RefUnwindSafe for Adam<D>where
Vec<AdamParam<D>>: RefUnwindSafe,
impl<D> Send for Adam<D>
impl<D> Sync for Adam<D>
impl<D> Unpin for Adam<D>
impl<D> UnsafeUnpin for Adam<D>where
Vec<AdamParam<D>>: UnsafeUnpin,
impl<D> UnwindSafe for Adam<D>where
Vec<AdamParam<D>>: UnwindSafe,
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> 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