pub struct AdamW { /* private fields */ }Expand description
AdamW optimizer.
See:
- Decoupled Weight Decay Regularization, Loshchilov and Hutter, 2019.
- Cautious Weight Decay, 2025
- On the Convergence of Adam and Beyond
Configured by AdamWConfig.
Trait Implementations§
Source§impl<B: Backend> SimpleOptimizer<B> for AdamW
impl<B: Backend> SimpleOptimizer<B> for AdamW
Source§fn step<const D: usize>(
&self,
lr: LearningRate,
tensor: Tensor<B, D>,
grad: Tensor<B, D>,
state: Option<Self::State<D>>,
) -> (Tensor<B, D>, Option<Self::State<D>>)
fn step<const D: usize>( &self, lr: LearningRate, tensor: Tensor<B, D>, grad: Tensor<B, D>, state: Option<Self::State<D>>, ) -> (Tensor<B, D>, Option<Self::State<D>>)
A single optimization step for any tensor that represents the parameters of a model.
Auto Trait Implementations§
impl Freeze for AdamW
impl RefUnwindSafe for AdamW
impl Send for AdamW
impl Sync for AdamW
impl Unpin for AdamW
impl UnsafeUnpin for AdamW
impl UnwindSafe for AdamW
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