saealib.GaussianKernel#

class saealib.GaussianKernel(*, length_scale=None)[source]#

Bases: RBFKernel

Gaussian radial basis function kernel.

Uses the exp(-0.5 * (r / length_scale)^2) parameterization; equivalent to the papers’ exp(-gamma * r^2) form with gamma = 1 / (2 * length_scale^2). Based on [16, 17].

Parameters:

length_scale (float or None) – Kernel width parameter, in the same distance units as the input data. None resolves to the median pairwise training-point distance at fit time.

Methods

__init__

evaluate

Evaluate the Gaussian kernel exp(-0.5 * (r / length_scale)**2).

pairwise

Evaluate the kernel between every row of x1 and x2.

resolve

Resolve length_scale from training data if unset.

validate

Validate length_scale.

Method Details

GaussianKernel.__init__(*, length_scale=None)#
Parameters:

length_scale (float | None)

Return type:

None

GaussianKernel.evaluate(r)[source]#

Evaluate the Gaussian kernel exp(-0.5 * (r / length_scale)**2).

Parameters:

r (ndarray)

Return type:

ndarray

GaussianKernel.pairwise(x1, x2)#

Evaluate the kernel between every row of x1 and x2.

Parameters:
  • x1 (ndarray)

  • x2 (ndarray)

Return type:

ndarray

GaussianKernel.resolve(train_x)[source]#

Resolve length_scale from training data if unset.

Parameters:

train_x (ndarray)

Return type:

Self

GaussianKernel.validate()[source]#

Validate length_scale.

Return type:

None