Skip to main content

ObjectiveFunction

Trait ObjectiveFunction 

Source
pub trait ObjectiveFunction: Send + Sync {
    // Required methods
    fn evaluate(&self, parameters: &[f32]) -> OptimizerResult<f32>;
    fn dimension(&self) -> usize;
    fn bounds(&self) -> (Vec<f32>, Vec<f32>);

    // Provided methods
    fn name(&self) -> &str { ... }
    fn is_noisy(&self) -> bool { ... }
}
Expand description

Trait for objective functions in Bayesian optimization

Required Methods§

Source

fn evaluate(&self, parameters: &[f32]) -> OptimizerResult<f32>

Evaluate the objective function (to be minimized)

Source

fn dimension(&self) -> usize

Get the dimension of the parameter space

Source

fn bounds(&self) -> (Vec<f32>, Vec<f32>)

Get parameter bounds (required for Bayesian optimization)

Provided Methods§

Source

fn name(&self) -> &str

Get the name of the objective function

Source

fn is_noisy(&self) -> bool

Whether the function is noisy (affects GP model)

Implementors§