Skip to main content

TrialExecutor

Trait TrialExecutor 

Source
pub trait TrialExecutor: Send + Sync {
    // Required method
    fn execute_trial(
        &self,
        params: &HashMap<String, Value>,
        ctx: &TrialContext,
    ) -> Result<TrialOutcome>;
}
Expand description

Callback that executes a trial given sampled parameters.

Returns Ok(TrialOutcome) for normal completion or pruning, Err(SomaError) only for unexpected failures.

Required Methods§

Source

fn execute_trial( &self, params: &HashMap<String, Value>, ctx: &TrialContext, ) -> Result<TrialOutcome>

Run one trial with the sampled params, reporting intermediate metrics through ctx and honouring its pruning verdicts.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§