pub trait MetricSchedulerTrait<F: Float + Debug + Display + FromPrimitive> {
// Required methods
fn step_with_metric(&mut self, metric: F) -> F;
fn get_learning_rate(&self) -> F;
fn reset(&mut self);
fn set_mode(&mut self, mode: OptimizationMode);
}Expand description
Trait for external scheduler integration
This trait can be implemented by external schedulers (like those in scirs2-optim) to provide seamless integration with metrics.
Required Methods§
Sourcefn step_with_metric(&mut self, metric: F) -> F
fn step_with_metric(&mut self, metric: F) -> F
Update the scheduler with a new metric value
Sourcefn get_learning_rate(&self) -> F
fn get_learning_rate(&self) -> F
Get the current learning rate
Sourcefn set_mode(&mut self, mode: OptimizationMode)
fn set_mode(&mut self, mode: OptimizationMode)
Set the mode (minimize or maximize)