pub struct RMSProp<B>where
B: Backend,{ /* private fields */ }Expand description
RMSProp optimizer.
Adapts the learning rate per-parameter using a running average of squared gradients.
§Default hyperparameters
lr: 0.01alpha: 0.99 (smoothing constant)epsilon: 1e-8momentum: 0.0weight_decay: 0.0
Implementations§
Source§impl<B> RMSProp<B>where
B: Backend,
impl<B> RMSProp<B>where
B: Backend,
Sourcepub fn new(params: Vec<Tensor<B>>, lr: f64) -> RMSProp<B>
pub fn new(params: Vec<Tensor<B>>, lr: f64) -> RMSProp<B>
Create a new RMSProp optimizer with default hyperparameters.
Sourcepub fn weight_decay(self, wd: f64) -> RMSProp<B>
pub fn weight_decay(self, wd: f64) -> RMSProp<B>
Set weight decay / L2 penalty (default: 0).
Sourcepub fn params_mut(&mut self) -> &mut Vec<Tensor<B>>
pub fn params_mut(&mut self) -> &mut Vec<Tensor<B>>
Mutable access to current parameters.
Trait Implementations§
Source§impl<B> Stateful for RMSProp<B>where
B: Backend,
impl<B> Stateful for RMSProp<B>where
B: Backend,
Source§fn state_dict(&self) -> OptimizerState
fn state_dict(&self) -> OptimizerState
Export the optimizer’s internal state as a serializable dictionary.
Source§fn load_state_dict(&mut self, state: &OptimizerState) -> Result<(), Error>
fn load_state_dict(&mut self, state: &OptimizerState) -> Result<(), Error>
Restore the optimizer’s internal state from a previously saved dictionary. Read more
Auto Trait Implementations§
impl<B> Freeze for RMSProp<B>
impl<B> RefUnwindSafe for RMSProp<B>
impl<B> Send for RMSProp<B>
impl<B> Sync for RMSProp<B>
impl<B> Unpin for RMSProp<B>
impl<B> UnwindSafe for RMSProp<B>
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