pub struct Momentum<B: Backend> { /* private fields */ }Expand description
Momemtum implementation that transforms gradients.
Implementations§
source§impl<B: Backend> Momentum<B>
impl<B: Backend> Momentum<B>
sourcepub fn new(config: &MomentumConfig) -> Self
pub fn new(config: &MomentumConfig) -> Self
sourcepub fn transform<const D: usize>(
&self,
grad: Tensor<B, D>,
state: Option<MomentumState<B, D>>
) -> (Tensor<B, D>, MomentumState<B, D>)
pub fn transform<const D: usize>( &self, grad: Tensor<B, D>, state: Option<MomentumState<B, D>> ) -> (Tensor<B, D>, MomentumState<B, D>)
Auto Trait Implementations§
impl<B> RefUnwindSafe for Momentum<B>where <B as Backend>::FloatElem: RefUnwindSafe,
impl<B> Send for Momentum<B>
impl<B> Sync for Momentum<B>
impl<B> Unpin for Momentum<B>where <B as Backend>::FloatElem: Unpin,
impl<B> UnwindSafe for Momentum<B>where <B as Backend>::FloatElem: 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