pub struct AdamW<B: Backend> { /* private fields */ }Expand description
AdamW optimizer as described in the paper Decoupled Weight Decay Regularization, Loshchilov and Hutter, 2019.
Trait Implementations§
source§impl<B: Backend> SimpleOptimizer<B> for AdamW<B>
impl<B: Backend> SimpleOptimizer<B> for AdamW<B>
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.
§type State<const D: usize> = AdamWState<B, D>
type State<const D: usize> = AdamWState<B, D>
The state of the optimizer. It also implements record, so that it can be saved.
Auto Trait Implementations§
impl<B> RefUnwindSafe for AdamW<B>where B: RefUnwindSafe,
impl<B> Send for AdamW<B>
impl<B> Sync for AdamW<B>
impl<B> Unpin for AdamW<B>where B: Unpin,
impl<B> UnwindSafe for AdamW<B>where B: 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