pub trait ExtendedOptimizerPlugin<A: Float>: OptimizerPlugin<A> {
// Required methods
fn batch_step(
&mut self,
params: &Array2<A>,
gradients: &Array2<A>,
) -> Result<Array2<A>>;
fn adaptive_learning_rate(&self, gradients: &Array1<A>) -> A;
fn preprocess_gradients(&self, gradients: &Array1<A>) -> Result<Array1<A>>;
fn postprocess_parameters(&self, params: &Array1<A>) -> Result<Array1<A>>;
fn get_trajectory(&self) -> Vec<Array1<A>> ⓘ;
fn convergence_metrics(&self) -> ConvergenceMetrics;
}Expand description
Extended plugin trait for optimizers with advanced features
Required Methods§
Sourcefn batch_step(
&mut self,
params: &Array2<A>,
gradients: &Array2<A>,
) -> Result<Array2<A>>
fn batch_step( &mut self, params: &Array2<A>, gradients: &Array2<A>, ) -> Result<Array2<A>>
Perform batch optimization step
Sourcefn adaptive_learning_rate(&self, gradients: &Array1<A>) -> A
fn adaptive_learning_rate(&self, gradients: &Array1<A>) -> A
Compute adaptive learning rate
Sourcefn preprocess_gradients(&self, gradients: &Array1<A>) -> Result<Array1<A>>
fn preprocess_gradients(&self, gradients: &Array1<A>) -> Result<Array1<A>>
Gradient preprocessing
Sourcefn postprocess_parameters(&self, params: &Array1<A>) -> Result<Array1<A>>
fn postprocess_parameters(&self, params: &Array1<A>) -> Result<Array1<A>>
Parameter postprocessing
Sourcefn get_trajectory(&self) -> Vec<Array1<A>> ⓘ
fn get_trajectory(&self) -> Vec<Array1<A>> ⓘ
Get optimization trajectory
Sourcefn convergence_metrics(&self) -> ConvergenceMetrics
fn convergence_metrics(&self) -> ConvergenceMetrics
Compute convergence metrics