pub struct MomentumSGDArgs<'a, T> { /* private fields */ }
Expand description
Defines the list passed to the cuda kernel function as arguments to the Momentum SGD optimizer.
Implementations§
Source§impl<'a, T> MomentumSGDArgs<'a, T>
Create an instance of an object representing the argument list of the Momentum SGD optimizer.
impl<'a, T> MomentumSGDArgs<'a, T>
Create an instance of an object representing the argument list of the Momentum SGD optimizer.
Sourcepub fn new(
weight: &'a mut CudaMutPtr<'a, CudaMemoryPoolPtr<T>>,
grad: &'a CudaMemoryPoolPtr<T>,
size: usize,
a: T,
mu: T,
weight_decay: T,
vt: &'a mut CudaMemoryPoolPtr<T>,
) -> MomentumSGDArgs<'a, T>
pub fn new( weight: &'a mut CudaMutPtr<'a, CudaMemoryPoolPtr<T>>, grad: &'a CudaMemoryPoolPtr<T>, size: usize, a: T, mu: T, weight_decay: T, vt: &'a mut CudaMemoryPoolPtr<T>, ) -> MomentumSGDArgs<'a, T>
Create a MomentumSGDArgs instance
§Arguments
weight
- unit weightgrad
- gradientsize
- number of weights to be updateda
- learning ratemu
- muweight_decay
- Weight decayvt
- vt
Trait Implementations§
Source§impl<'a, T> KernelArgs for MomentumSGDArgs<'a, T>where
T: AsKernelPtr,
impl<'a, T> KernelArgs for MomentumSGDArgs<'a, T>where
T: AsKernelPtr,
Source§fn as_vec(&mut self) -> Vec<&mut dyn AsKernelPtr>
fn as_vec(&mut self) -> Vec<&mut dyn AsKernelPtr>
Returns a Vec<&mut dyn AsMutKernelPtr> of the type implementing AsMutKernelPtr,
which is converted to a data type that can be passed to the cuda kernel in subsequent processing.
Auto Trait Implementations§
impl<'a, T> Freeze for MomentumSGDArgs<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for MomentumSGDArgs<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for MomentumSGDArgs<'a, T>
impl<'a, T> !Sync for MomentumSGDArgs<'a, T>
impl<'a, T> Unpin for MomentumSGDArgs<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for MomentumSGDArgs<'a, T>
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
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