pub trait Kernel: Debug + Clone + PartialEq {
    // Required methods
    fn n_parameters(&self) -> usize;
    fn covariance<R1, R2, C1, C2, S1, S2>(
        &self,
        x1: &Matrix<f64, R1, C1, S1>,
        x2: &Matrix<f64, R2, C2, S2>
    ) -> DMatrix<f64>
       where R1: Dim,
             R2: Dim,
             C1: Dim,
             C2: Dim,
             S1: Storage<f64, R1, C1>,
             S2: Storage<f64, R2, C2>,
             ShapeConstraint: SameNumberOfColumns<C1, C2>;
    fn is_stationary(&self) -> bool;
    fn diag<R, C, S>(&self, x: &Matrix<f64, R, C, S>) -> DVector<f64>
       where R: Dim,
             C: Dim,
             S: Storage<f64, R, C>;
    fn parameters(&self) -> DVector<f64>;
    fn reparameterize(&self, params: &[f64]) -> Result<Self, KernelError>;
    fn covariance_with_gradient<R, C, S>(
        &self,
        x: &Matrix<f64, R, C, S>
    ) -> Result<(DMatrix<f64>, CovGrad), CovGradError>
       where R: Dim,
             C: Dim,
             S: Storage<f64, R, C>;

    // Provided methods
    fn consume_parameters<I: IntoIterator<Item = f64>>(
        &self,
        params: I
    ) -> Result<(Self, I::IntoIter), KernelError> { ... }
    fn add<B: Kernel>(self, other: B) -> AddKernel<Self, B> { ... }
    fn mul<B: Kernel>(self, other: B) -> ProductKernel<Self, B> { ... }
}
Expand description

Kernel Function

Required Methods§

source

fn n_parameters(&self) -> usize

Return the number of parameters used in this Kernel.

source

fn covariance<R1, R2, C1, C2, S1, S2>( &self, x1: &Matrix<f64, R1, C1, S1>, x2: &Matrix<f64, R2, C2, S2> ) -> DMatrix<f64>where R1: Dim, R2: Dim, C1: Dim, C2: Dim, S1: Storage<f64, R1, C1>, S2: Storage<f64, R2, C2>, ShapeConstraint: SameNumberOfColumns<C1, C2>,

Returns the covariance matrix for two equal sized vectors

source

fn is_stationary(&self) -> bool

Reports if the given kernel function is stationary.

source

fn diag<R, C, S>(&self, x: &Matrix<f64, R, C, S>) -> DVector<f64>where R: Dim, C: Dim, S: Storage<f64, R, C>,

Returns the diagonal of the kernel(x, x)

source

fn parameters(&self) -> DVector<f64>

Return the corresponding parameter vector The parameters here are in a log-scale

source

fn reparameterize(&self, params: &[f64]) -> Result<Self, KernelError>

Create a new kernel of the given type from the provided parameters. The parameters here are in a log-scale

source

fn covariance_with_gradient<R, C, S>( &self, x: &Matrix<f64, R, C, S> ) -> Result<(DMatrix<f64>, CovGrad), CovGradError>where R: Dim, C: Dim, S: Storage<f64, R, C>,

Covariance and Gradient with the log-scaled hyper-parameters

Provided Methods§

source

fn consume_parameters<I: IntoIterator<Item = f64>>( &self, params: I ) -> Result<(Self, I::IntoIter), KernelError>

Takes a sequence of parameters and consumes only the ones it needs to create itself. The parameters here are in a log-scale

source

fn add<B: Kernel>(self, other: B) -> AddKernel<Self, B>

source

fn mul<B: Kernel>(self, other: B) -> ProductKernel<Self, B>

Implementors§