pub enum Optimizer {
SGD(SGD),
SGDM(SGDM),
Adam(Adam),
AdamW(AdamW),
RMSprop(RMSprop),
}Expand description
The optimizer function.
Variants§
Implementations§
Source§impl Optimizer
impl Optimizer
Sourcepub fn update(
&mut self,
layer: usize,
filter: usize,
bias: bool,
stepnr: i32,
values: &mut Tensor,
gradients: &mut Tensor,
)
pub fn update( &mut self, layer: usize, filter: usize, bias: bool, stepnr: i32, values: &mut Tensor, gradients: &mut Tensor, )
Updates the weights of the layer.
§Arguments
layer- The layer of the network.filter- The filter of the layer. Always 0 if the layer is not a convolutional layer.bias- If the current values are the bias.stepnr- The step number of the training process (epoch).values- The weights of the layer (with optional bias stacked vertically).gradients- The gradients of the layer (with optional bias stacked vertically).
pub fn validate(&mut self, vectors: Vec<Vec<Vec<Tensor>>>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Optimizer
impl RefUnwindSafe for Optimizer
impl Send for Optimizer
impl Sync for Optimizer
impl Unpin for Optimizer
impl UnwindSafe for Optimizer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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