Struct primitiv::optimizers::MomentumSGD
[−]
[src]
pub struct MomentumSGD { /* fields omitted */ }
Stochastic gradient descent with momentum.
Methods
impl MomentumSGD
[src]
Trait Implementations
impl Debug for MomentumSGD
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Wrap<primitivOptimizer_t> for MomentumSGD
[src]
fn from_raw(ptr: *mut primitivOptimizer_t, _owned: bool) -> Self
[src]
fn as_ptr(&self) -> *const primitivOptimizer_t
[src]
fn as_mut_ptr(&mut self) -> *mut primitivOptimizer_t
[src]
fn is_owned(&self) -> bool
[src]
impl Drop for MomentumSGD
[src]
impl Optimizer for MomentumSGD
[src]
fn load<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Loads configurations from a file.
fn save<P: AsRef<Path>>(&self, path: P) -> Result<()>
[src]
Saves current configurations to a file.
fn get_epoch(&self) -> u32
[src]
Retrieves current epoch.
fn set_epoch(&mut self, epoch: u32)
[src]
Sets current epoch.
fn get_learning_rate_scaling(&self) -> f32
[src]
Retrieves current learning rate scaling factor.
fn set_learning_rate_scaling(&mut self, scale: f32)
[src]
Sets learning rate scaling factor.
fn get_weight_decay(&self) -> f32
[src]
Retrieves current L2 decay strength.
fn set_weight_decay(&mut self, strength: f32)
[src]
Sets L2 decay strength.
fn get_gradient_clipping(&self) -> f32
[src]
Retrieves current gradient clipping threshold.
fn set_gradient_clipping(&mut self, threshold: f32)
[src]
Sets gradient clipping threshold.
fn add_parameter(&mut self, param: &mut Parameter)
[src]
Registers a parameter.
fn add_parameters(&mut self, params: &mut [&mut Parameter])
[src]
Registers multiple parameters.
fn add_model<M: AsMut<Model>>(&mut self, model: &mut M)
[src]
Registers a model.
fn add_models<M: AsMut<Model>>(&mut self, models: &mut [&mut M])
[src]
Registers multiple models.
fn reset_gradients(&mut self)
[src]
Resets all gradients of registered parameters.
fn update(&mut self)
[src]
Updates parameter values.
fn get_uint_config(&self, key: &str) -> u32
[src]
Gets a configuration value.
fn set_uint_config(&mut self, key: &str, value: u32)
[src]
Sets a configuration value.
fn get_float_config(&self, key: &str) -> f32
[src]
Gets a configuration value.
fn set_float_config(&mut self, key: &str, value: f32)
[src]
Sets a configuration value.