pub struct NNOptimizerDescriptor { /* private fields */ }Expand description
Wraps MPSNNOptimizerDescriptor.
Implementations§
Source§impl NNOptimizerDescriptor
impl NNOptimizerDescriptor
Sourcepub fn new(
learning_rate: f32,
gradient_rescale: f32,
regularization_type: usize,
regularization_scale: f32,
) -> Option<Self>
pub fn new( learning_rate: f32, gradient_rescale: f32, regularization_type: usize, regularization_scale: f32, ) -> Option<Self>
Wraps a constructor on MPSNNOptimizerDescriptor.
Sourcepub fn with_gradient_clipping(
learning_rate: f32,
gradient_rescale: f32,
apply_gradient_clipping: bool,
gradient_clip_max: f32,
gradient_clip_min: f32,
regularization_type: usize,
regularization_scale: f32,
) -> Option<Self>
pub fn with_gradient_clipping( learning_rate: f32, gradient_rescale: f32, apply_gradient_clipping: bool, gradient_clip_max: f32, gradient_clip_min: f32, regularization_type: usize, regularization_scale: f32, ) -> Option<Self>
Wraps the corresponding MPSNNOptimizerDescriptor method.
Sourcepub fn learning_rate(&self) -> f32
pub fn learning_rate(&self) -> f32
Wraps the corresponding MPSNNOptimizerDescriptor method.
Sourcepub fn set_learning_rate(&self, value: f32)
pub fn set_learning_rate(&self, value: f32)
Wraps the corresponding MPSNNOptimizerDescriptor setter.
Sourcepub fn gradient_rescale(&self) -> f32
pub fn gradient_rescale(&self) -> f32
Wraps the corresponding MPSNNOptimizerDescriptor method.
Sourcepub fn set_gradient_rescale(&self, value: f32)
pub fn set_gradient_rescale(&self, value: f32)
Wraps the corresponding MPSNNOptimizerDescriptor setter.
Sourcepub fn apply_gradient_clipping(&self) -> bool
pub fn apply_gradient_clipping(&self) -> bool
Wraps the corresponding MPSNNOptimizerDescriptor method.
Sourcepub fn set_apply_gradient_clipping(&self, value: bool)
pub fn set_apply_gradient_clipping(&self, value: bool)
Wraps the corresponding MPSNNOptimizerDescriptor setter.
Sourcepub fn gradient_clip_max(&self) -> f32
pub fn gradient_clip_max(&self) -> f32
Wraps the corresponding MPSNNOptimizerDescriptor method.
Sourcepub fn set_gradient_clip_max(&self, value: f32)
pub fn set_gradient_clip_max(&self, value: f32)
Wraps the corresponding MPSNNOptimizerDescriptor setter.
Sourcepub fn gradient_clip_min(&self) -> f32
pub fn gradient_clip_min(&self) -> f32
Wraps the corresponding MPSNNOptimizerDescriptor method.
Sourcepub fn set_gradient_clip_min(&self, value: f32)
pub fn set_gradient_clip_min(&self, value: f32)
Wraps the corresponding MPSNNOptimizerDescriptor setter.
Sourcepub fn regularization_scale(&self) -> f32
pub fn regularization_scale(&self) -> f32
Wraps the corresponding MPSNNOptimizerDescriptor method.
Sourcepub fn set_regularization_scale(&self, value: f32)
pub fn set_regularization_scale(&self, value: f32)
Wraps the corresponding MPSNNOptimizerDescriptor setter.
Sourcepub fn regularization_type(&self) -> usize
pub fn regularization_type(&self) -> usize
Wraps the corresponding MPSNNOptimizerDescriptor method.
Sourcepub fn set_regularization_type(&self, value: usize)
pub fn set_regularization_type(&self, value: usize)
Wraps the corresponding MPSNNOptimizerDescriptor setter.