pub struct RMSprop {
pub learning_rate: f32,
pub alpha: f32,
pub eps: f32,
pub momentum: f32,
pub centered: bool,
pub weight_decay: f32,
pub t: usize,
/* private fields */
}Expand description
RMSProp optimizer for adaptive learning rate training.
Fields§
§learning_rate: f32Step size multiplier
alpha: f32Controls how quickly the cache forgets old gradients
eps: f32Small constant to avoid division by zero
momentum: f32Momentum
centered: boolCentered
weight_decay: f32Weight decay
t: usizet
Implementations§
Source§impl RMSprop
impl RMSprop
Sourcepub fn update<'a>(
&mut self,
parameters: impl IntoIterator<Item = &'a mut Tensor>,
gradients: impl IntoIterator<Item = Tensor>,
)
pub fn update<'a>( &mut self, parameters: impl IntoIterator<Item = &'a mut Tensor>, gradients: impl IntoIterator<Item = Tensor>, )
update
Trait Implementations§
Source§impl<'a> IntoIterator for &'a RMSprop
impl<'a> IntoIterator for &'a RMSprop
Source§impl<'a> IntoIterator for &'a mut RMSprop
impl<'a> IntoIterator for &'a mut RMSprop
Source§impl Module for RMSprop
impl Module for RMSprop
Source§fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Tensor>
fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Tensor>
Iterate over all tensors mutably
Source§fn iter_tensors<'a>(&'a self) -> impl Iterator<Item = (String, &'a Tensor)>
fn iter_tensors<'a>(&'a self) -> impl Iterator<Item = (String, &'a Tensor)>
Iterate over tensors without consuming the module
Source§fn iter_tensors_mut<'a>(
&'a mut self,
) -> impl Iterator<Item = (String, &'a mut Tensor)>
fn iter_tensors_mut<'a>( &'a mut self, ) -> impl Iterator<Item = (String, &'a mut Tensor)>
From tensors
Source§fn set_params(&mut self, params: &mut HashMap<String, Tensor>)
fn set_params(&mut self, params: &mut HashMap<String, Tensor>)
Set parameters, removes them from params, skips parameters that are not found in params.
Source§fn save(&self, path: impl AsRef<Path>) -> Result<(), ZyxError>
fn save(&self, path: impl AsRef<Path>) -> Result<(), ZyxError>
Save tensors or modules to a file determined by file extension.
Currently only safetensors is supported format. Read more
Source§fn save_numpy(&self, path: impl AsRef<Path>) -> Result<(), ZyxError>
fn save_numpy(&self, path: impl AsRef<Path>) -> Result<(), ZyxError>
Save a single tensor to a
.npy file (numpy array format).
Mirrors load_numpy: little-endian, C order (Fortran order
is never written). Header is padded so data starts at a 64-byte
boundary, like numpy >= 1.9. Numpy files hold a single array, so
saving a module with more than one tensor is an error. Read moreAuto 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