pub trait OptimizerState<Input, Output, M: OptimizableModel<Input, Output>> {
// Required method
fn update_weights(&mut self, model: &mut M) -> Result<(), ModelError>;
// Provided method
fn initialize(&self) { ... }
}Expand description
OptimizerState trait defines the interface for managing the state of an optimizer. It provides methods to initialize the optimizer state and update the model weights. This trait is useful to implement custom parameter update rules, as used in different optimization algorithms, like RMSProp, Adam, etc.
Required Methods§
fn update_weights(&mut self, model: &mut M) -> Result<(), ModelError>
Provided Methods§
fn initialize(&self)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".