Skip to main content

Pruner

Trait Pruner 

Source
pub trait Pruner: Send + Sync {
    // Required method
    fn should_prune(
        &self,
        metric_name: &str,
        current_value: f64,
        step: usize,
        history: &[TrialMetricHistory],
    ) -> Option<String>;
}
Expand description

A pruner decides whether to stop a trial early based on intermediate metrics.

Required Methods§

Source

fn should_prune( &self, metric_name: &str, current_value: f64, step: usize, history: &[TrialMetricHistory], ) -> Option<String>

Decide whether to prune given the current trial’s metrics and the history of completed trials’ metrics at the same step.

Returns Some(reason) if the trial should be pruned.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§