Trait Optimizer

Source
pub trait Optimizer {
    // Required methods
    fn update(
        &mut self,
        param_id: &str,
        param: &mut Array2<f64>,
        gradient: &Array2<f64>,
    );
    fn reset(&mut self);
    fn set_learning_rate(&mut self, lr: f64);
    fn get_learning_rate(&self) -> f64;
}
Expand description

Optimizer trait for parameter updates during training

Required Methods§

Source

fn update( &mut self, param_id: &str, param: &mut Array2<f64>, gradient: &Array2<f64>, )

Source

fn reset(&mut self)

Source

fn set_learning_rate(&mut self, lr: f64)

Set the learning rate dynamically (for compatibility with schedulers)

Source

fn get_learning_rate(&self) -> f64

Get the current learning rate

Implementors§