Skip to main content

Sampler

Trait Sampler 

Source
pub trait Sampler: Send + Sync {
    // Required methods
    fn sample(
        &mut self,
        space: &SearchSpace,
        trial_index: usize,
    ) -> Result<Option<HashMap<String, Value>>>;
    fn n_trials(&self) -> Option<usize>;
}
Expand description

A sampler produces hyperparameter configurations from a search space.

Required Methods§

Source

fn sample( &mut self, space: &SearchSpace, trial_index: usize, ) -> Result<Option<HashMap<String, Value>>>

Sample the next set of parameters. Returns None when exhausted.

Source

fn n_trials(&self) -> Option<usize>

Total number of trials this sampler will produce (if known).

Implementors§