Skip to main content

Optimizer

Trait Optimizer 

Source
pub trait Optimizer {
    type Device: Device;

    // Required methods
    fn get_lr(&self) -> f64;
    fn set_lr(&mut self, lr: f64);
    fn step(&mut self, grads: &GradStore<Self::Device>) -> Result<()>;
    fn state_dict(&self) -> Result<LumaPack<Self::Device>>;
    fn load_state_dict(&mut self, pack: &LumaPack<Self::Device>) -> Result<()>;
}

Required Associated Types§

Required Methods§

Source

fn get_lr(&self) -> f64

Source

fn set_lr(&mut self, lr: f64)

Source

fn step(&mut self, grads: &GradStore<Self::Device>) -> Result<()>

Source

fn state_dict(&self) -> Result<LumaPack<Self::Device>>

Source

fn load_state_dict(&mut self, pack: &LumaPack<Self::Device>) -> Result<()>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§