pub struct AdamBuilder<U, D>{ /* private fields */ }Expand description
Implementation of a builder to generate Adam optimizers
Implementations§
Source§impl<U, D> AdamBuilder<U, D>
impl<U, D> AdamBuilder<U, D>
Sourcepub fn new(device: &D) -> AdamBuilder<U, D>
pub fn new(device: &D) -> AdamBuilder<U, D>
Create an instance of AdamBuilder with additional parameters other than the default values
§Arguments
device- device
Sourcepub fn lr(self, lr: U) -> AdamBuilder<U, D>
pub fn lr(self, lr: U) -> AdamBuilder<U, D>
Replaces the value of field lr in AdamBuilder with the passed value and returns it.
§Arguments
lr- Learning rate
Sourcepub fn weight_decay(self, weight_decay: U) -> AdamBuilder<U, D>
pub fn weight_decay(self, weight_decay: U) -> AdamBuilder<U, D>
Replaces the value of field weight_decay in AdamBuilder with the passed value and returns it.
§Arguments
weight_decay- Learning rate
Sourcepub fn b1(self, b1: U) -> AdamBuilder<U, D>
pub fn b1(self, b1: U) -> AdamBuilder<U, D>
Replaces the value of field b1 in AdamBuilder with the passed value and returns it.
§Arguments
b1- b1
Sourcepub fn b2(self, b2: U) -> AdamBuilder<U, D>
pub fn b2(self, b2: U) -> AdamBuilder<U, D>
Replaces the value of field b2 in AdamBuilder with the passed value and returns it.
§Arguments
b2- b2
Trait Implementations§
Source§impl<U> OptimizerBuilder<U, DeviceCpu<U>> for AdamBuilder<U, DeviceCpu<U>>
impl<U> OptimizerBuilder<U, DeviceCpu<U>> for AdamBuilder<U, DeviceCpu<U>>
Source§impl<U> OptimizerBuilder<U, DeviceGpu<U>> for AdamBuilder<U, DeviceGpu<U>>
impl<U> OptimizerBuilder<U, DeviceGpu<U>> for AdamBuilder<U, DeviceGpu<U>>
Auto Trait Implementations§
impl<U, D> Freeze for AdamBuilder<U, D>
impl<U, D> RefUnwindSafe for AdamBuilder<U, D>where
U: RefUnwindSafe,
D: RefUnwindSafe,
impl<U, D> Send for AdamBuilder<U, D>where
D: Send,
impl<U, D> Sync for AdamBuilder<U, D>where
D: Sync,
impl<U, D> Unpin for AdamBuilder<U, D>
impl<U, D> UnwindSafe for AdamBuilder<U, D>where
U: UnwindSafe,
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
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