pub struct RMSprop {
pub cfg: RMSpropConfig,
/* private fields */
}
Expand description
RMSprop As described in Hinton, 2012.
This implementation is based off of RMSprop from pytorch-image-models.
The pytorch implementation has some issues: https://github.com/pytorch/pytorch/issues/23796.
Note: we don’t provide lr_in_momentum option because it didn’t seem to make a difference in testing.
Example Usage:
let mut t = Tensor0D::ones();
let mut opt: RMSprop = Default::default();
let gradients = t.trace().backward();
opt.update(&mut t, gradients);
Changing default parmeters:
let rmsprop = RMSprop::new(RMSpropConfig {
lr: 1e-3,
alpha: 0.5,
..Default::default()
});
Fields
cfg: RMSpropConfig
Configuration like learning rate and momentum.
Implementations
sourceimpl RMSprop
impl RMSprop
sourcepub fn new(cfg: RMSpropConfig) -> Self
pub fn new(cfg: RMSpropConfig) -> Self
Constructs a new RMSprop using cfg
RMSpropConfig.
Trait Implementations
sourceimpl GradientProvider for RMSprop
impl GradientProvider for RMSprop
sourcefn gradient<P>(&mut self, p: &P) -> Box<P::Array> where
P: HasUniqueId + HasArrayType<Dtype = f32> + HasDevice,
fn gradient<P>(&mut self, p: &P) -> Box<P::Array> where
P: HasUniqueId + HasArrayType<Dtype = f32> + HasDevice,
Retrieves the data associated with p
if there is any.
This can modify self
, for instance if velocities are calculated
based on the associated data! Read more
Auto Trait Implementations
impl !RefUnwindSafe for RMSprop
impl !Send for RMSprop
impl !Sync for RMSprop
impl Unpin for RMSprop
impl !UnwindSafe for RMSprop
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more