pub trait SurrogateKernel: Send + Sync {
// Required methods
fn eval(&self, x1: &ArrayView1<'_, f64>, x2: &ArrayView1<'_, f64>) -> f64;
fn get_log_params(&self) -> Vec<f64>;
fn set_log_params(&mut self, params: &[f64]);
fn clone_box(&self) -> Box<dyn SurrogateKernel>;
fn name(&self) -> &str;
// Provided methods
fn covariance_matrix(&self, x: &Array2<f64>) -> Array2<f64> { ... }
fn cross_covariance(
&self,
x1: &Array2<f64>,
x2: &Array2<f64>,
) -> Array2<f64> { ... }
fn n_params(&self) -> usize { ... }
}Expand description
Trait for covariance (kernel) functions used by the GP surrogate.
Required Methods§
Sourcefn eval(&self, x1: &ArrayView1<'_, f64>, x2: &ArrayView1<'_, f64>) -> f64
fn eval(&self, x1: &ArrayView1<'_, f64>, x2: &ArrayView1<'_, f64>) -> f64
Evaluate the kernel between two input vectors.
Sourcefn get_log_params(&self) -> Vec<f64>
fn get_log_params(&self) -> Vec<f64>
Return current hyperparameters as a flat vector (log-scale).
Sourcefn set_log_params(&mut self, params: &[f64])
fn set_log_params(&mut self, params: &[f64])
Set hyperparameters from a flat vector (log-scale).
Sourcefn clone_box(&self) -> Box<dyn SurrogateKernel>
fn clone_box(&self) -> Box<dyn SurrogateKernel>
Clone the kernel into a boxed trait object.
Provided Methods§
Sourcefn covariance_matrix(&self, x: &Array2<f64>) -> Array2<f64>
fn covariance_matrix(&self, x: &Array2<f64>) -> Array2<f64>
Compute the full covariance matrix for a set of inputs.