geoml.kernels

Covariance functions. A kernel is handed to a GP node together with a transform, which is what carries the ranges and the anisotropy: the kernel says how correlation falls with distance, and the transform says what distance means.

class geoml.kernels.Gaussian[source]

Bases: _Kernel

Gaussian kernel

kernelize(x)[source]
class geoml.kernels.Spherical(epsilon=1e-12)[source]

Bases: _Kernel

Spherical kernel

kernelize(x)[source]
class geoml.kernels.Exponential(epsilon=1e-12)[source]

Bases: _Kernel

Exponential kernel

kernelize(x)[source]
class geoml.kernels.Cubic[source]

Bases: _Kernel

Cubic kernel

kernelize(x)[source]
class geoml.kernels.Constant[source]

Bases: _Kernel

Constant kernel

kernelize(x)[source]
implicit_matmul(coordinates)[source]

Implicit matrix-vector multiplication.

Returns a function that multiplies the kernel’s covariance matrix (defined at the given coordinates) with a vector efficiently.

class geoml.kernels.Linear(transform=Identity())[source]

Bases: _AbstractCovariance

Linear covariance

covariance_matrix(x, y)[source]

Computes point-point covariance matrix between x and y tensors.

point_variance(x)[source]

Computes the data points’ self variance (covariance between the point and itself).

implicit_matmul(coordinates)[source]

Implicit matrix-vector multiplication.

Returns a function that multiplies the kernel’s covariance matrix (defined at the given coordinates) with a vector efficiently.

feature_matrix(x)[source]
class geoml.kernels.Cosine[source]

Bases: _Kernel

Cosine kernel

kernelize(x)[source]
class geoml.kernels.Sum(*args)[source]

Bases: _NodeCovariance

Kernel sum

__init__(*args)[source]

Kernel sum.

Parameters:

args – Kernels to compute the sum.

class geoml.kernels.Product(*args)[source]

Bases: _NodeCovariance

Kernel product

__init__(*args)[source]

Kernel product.

Parameters:

args – Kernels to compute the product.

covariance_matrix_d1(x, y, dir_y)[source]

Computes point-direction covariance matrix between x and y tensors.

covariance_matrix_d2(x, y, dir_x, dir_y)[source]

Computes direction-direction covariance matrix between x and y tensors.

self_covariance_matrix_d2(x, dir_x)[source]
class geoml.kernels.Matern32[source]

Bases: _Kernel

Once differentiable Matérn kernel.

kernelize(x)[source]
class geoml.kernels.Matern52[source]

Bases: _Kernel

Twice differentiable Matérn kernel.

kernelize(x)[source]
class geoml.kernels.Scale(base_covariance)[source]

Bases: _WrapperCovariance

Kernel scaling.

Add a parameter allowing for non-unit variance.

covariance_matrix(x, y)[source]

Computes point-point covariance matrix between x and y tensors.

point_variance(x)[source]

Computes the data points’ self variance (covariance between the point and itself).

covariance_matrix_d1(x, y, dir_y)[source]

Computes point-direction covariance matrix between x and y tensors.

covariance_matrix_d2(x, y, dir_x, dir_y)[source]

Computes direction-direction covariance matrix between x and y tensors.

point_variance_d2(x, dir_x)[source]