pub struct RMSprop { /* private fields */ }Expand description
RMSprop optimizer.
Maintains a moving average of squared gradients for adaptive learning rates.
Update rule:
v_t = α * v_{t-1} + (1 - α) * grad²
param = param - lr * grad / (√v_t + ε)Implementations§
Source§impl RMSprop
impl RMSprop
Sourcepub fn new(params: Vec<&mut Tensor>, lr: f32) -> Self
pub fn new(params: Vec<&mut Tensor>, lr: f32) -> Self
Create a new RMSprop optimizer.
Default: α=0.99, ε=1e-8
pub fn alpha(self, alpha: f32) -> Self
pub fn eps(self, eps: f32) -> Self
pub fn momentum(self, momentum: f32) -> Self
pub fn weight_decay(self, wd: f32) -> Self
pub fn step_with_params(&mut self, params: &mut [&mut Tensor])
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RMSprop
impl RefUnwindSafe for RMSprop
impl Send for RMSprop
impl Sync for RMSprop
impl Unpin for RMSprop
impl UnsafeUnpin for RMSprop
impl UnwindSafe for RMSprop
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