pub struct NNOptimizerAdam { /* private fields */ }Expand description
Wraps MPSNNOptimizerAdam.
Implementations§
Source§impl NNOptimizerAdam
impl NNOptimizerAdam
Sourcepub fn learning_rate(&self) -> f32
pub fn learning_rate(&self) -> f32
Wraps the corresponding Metal Performance Shaders method.
Sourcepub fn set_learning_rate(&self, value: f32)
pub fn set_learning_rate(&self, value: f32)
Wraps the corresponding Metal Performance Shaders method.
Sourcepub fn gradient_rescale(&self) -> f32
pub fn gradient_rescale(&self) -> f32
Wraps the corresponding Metal Performance Shaders method.
Sourcepub fn apply_gradient_clipping(&self) -> bool
pub fn apply_gradient_clipping(&self) -> bool
Wraps the corresponding Metal Performance Shaders method.
Sourcepub fn set_apply_gradient_clipping(&self, value: bool)
pub fn set_apply_gradient_clipping(&self, value: bool)
Wraps the corresponding Metal Performance Shaders method.
Sourcepub fn gradient_clip_max(&self) -> f32
pub fn gradient_clip_max(&self) -> f32
Wraps the corresponding Metal Performance Shaders method.
Sourcepub fn gradient_clip_min(&self) -> f32
pub fn gradient_clip_min(&self) -> f32
Wraps the corresponding Metal Performance Shaders method.
Sourcepub fn regularization_scale(&self) -> f32
pub fn regularization_scale(&self) -> f32
Wraps the corresponding Metal Performance Shaders method.
Sourcepub fn regularization_type(&self) -> usize
pub fn regularization_type(&self) -> usize
Wraps the corresponding Metal Performance Shaders method.
Source§impl NNOptimizerAdam
impl NNOptimizerAdam
Sourcepub fn new(device: &MetalDevice, learning_rate: f32) -> Option<Self>
pub fn new(device: &MetalDevice, learning_rate: f32) -> Option<Self>
Wraps a constructor on MPSNNOptimizerAdam.
Sourcepub fn new_with_options(
device: &MetalDevice,
beta1: f64,
beta2: f64,
epsilon: f32,
time_step: usize,
optimizer_descriptor: &NNOptimizerDescriptor,
) -> Option<Self>
pub fn new_with_options( device: &MetalDevice, beta1: f64, beta2: f64, epsilon: f32, time_step: usize, optimizer_descriptor: &NNOptimizerDescriptor, ) -> Option<Self>
Wraps a constructor on MPSNNOptimizerAdam.
Sourcepub fn as_optimizer(&self) -> Option<NNOptimizer>
pub fn as_optimizer(&self) -> Option<NNOptimizer>
Wraps the corresponding MPSNNOptimizerAdam conversion helper.
Sourcepub fn set_time_step(&self, value: usize)
pub fn set_time_step(&self, value: usize)
Wraps the corresponding MPSNNOptimizerAdam setter.
Sourcepub fn encode_vector(
&self,
command_buffer: &CommandBuffer,
input_gradient_vector: &Vector,
input_values_vector: &Vector,
input_momentum_vector: &Vector,
input_velocity_vector: &Vector,
result_values_vector: &Vector,
)
pub fn encode_vector( &self, command_buffer: &CommandBuffer, input_gradient_vector: &Vector, input_values_vector: &Vector, input_momentum_vector: &Vector, input_velocity_vector: &Vector, result_values_vector: &Vector, )
Wraps the corresponding MPSNNOptimizerAdam encode entry point.
Sourcepub fn encode_matrix(
&self,
command_buffer: &CommandBuffer,
input_gradient_matrix: &Matrix,
input_values_matrix: &Matrix,
input_momentum_matrix: &Matrix,
input_velocity_matrix: &Matrix,
result_values_matrix: &Matrix,
)
pub fn encode_matrix( &self, command_buffer: &CommandBuffer, input_gradient_matrix: &Matrix, input_values_matrix: &Matrix, input_momentum_matrix: &Matrix, input_velocity_matrix: &Matrix, result_values_matrix: &Matrix, )
Wraps the corresponding MPSNNOptimizerAdam encode entry point.
Sourcepub fn encode_amsgrad_vector(
&self,
command_buffer: &CommandBuffer,
input_gradient_vector: &Vector,
input_values_vector: &Vector,
input_momentum_vector: &Vector,
input_velocity_vector: &Vector,
maximum_velocity_vector: Option<&Vector>,
result_values_vector: &Vector,
)
pub fn encode_amsgrad_vector( &self, command_buffer: &CommandBuffer, input_gradient_vector: &Vector, input_values_vector: &Vector, input_momentum_vector: &Vector, input_velocity_vector: &Vector, maximum_velocity_vector: Option<&Vector>, result_values_vector: &Vector, )
Wraps the corresponding MPSNNOptimizerAdam encode entry point.
Sourcepub fn encode_amsgrad_matrix(
&self,
command_buffer: &CommandBuffer,
input_gradient_matrix: &Matrix,
input_values_matrix: &Matrix,
input_momentum_matrix: &Matrix,
input_velocity_matrix: &Matrix,
maximum_velocity_matrix: Option<&Matrix>,
result_values_matrix: &Matrix,
)
pub fn encode_amsgrad_matrix( &self, command_buffer: &CommandBuffer, input_gradient_matrix: &Matrix, input_values_matrix: &Matrix, input_momentum_matrix: &Matrix, input_velocity_matrix: &Matrix, maximum_velocity_matrix: Option<&Matrix>, result_values_matrix: &Matrix, )
Wraps the corresponding MPSNNOptimizerAdam encode entry point.