Skip to main content

Callback

Trait Callback 

Source
pub trait Callback<P: ParamKey> {
    // Provided methods
    fn on_start(&mut self, _space: &SearchSpace<P>) { ... }
    fn on_trial_start(&mut self, _trial_num: usize, _trial: &Trial<P>) { ... }
    fn on_trial_end(&mut self, _trial_num: usize, _result: &TrialResult<P>) { ... }
    fn on_end(&mut self, _best: Option<&TrialResult<P>>) { ... }
    fn should_stop(&self) -> bool { ... }
}
Expand description

Callback trait for monitoring optimization progress.

Provided Methods§

Source

fn on_start(&mut self, _space: &SearchSpace<P>)

Called at the start of optimization.

Source

fn on_trial_start(&mut self, _trial_num: usize, _trial: &Trial<P>)

Called before each trial.

Source

fn on_trial_end(&mut self, _trial_num: usize, _result: &TrialResult<P>)

Called after each trial with results.

Source

fn on_end(&mut self, _best: Option<&TrialResult<P>>)

Called at the end of optimization.

Source

fn should_stop(&self) -> bool

Return true to stop optimization early.

Implementors§