Gaussian kernel

class gp.kernels.gaussian.GaussianKernel(h, w)[source]

Bases: gp.kernels.base.Kernel

Gaussian kernel function.

Parameters :

h : float

Output scale kernel parameter

w : float

Input scale kernel parameter

Notes

The Gaussian kernel is defined as:

\[K(x_1, x_2) = \frac{h^2}{\sqrt{2\pi w^2}}\exp\left(-\frac{(x_1-x_2)^2}{2w^2}\right),\]

where \(w\) is the input scale parameter (equivalent to the standard deviation of the Gaussian) and \(h\) is the output scale parameter.

K(x1, x2, out=None)[source]

Kernel function evaluated at x1 and x2.

Parameters :

x1 : numpy.ndarray with dtype='f8'

\(n\)-length vector

x2 : numpy.ndarray with dtype='f8'

\(m\)-length vector

Returns :

K : numpy.ndarray

\(n\times m\) array

copy()

Create a copy of the kernel.

Returns :

kernel : Kernel

New kernel function object of type type(self).

d2K_dhdh(x1, x2, out=None)[source]
d2K_dhdw(x1, x2, out=None)[source]
d2K_dwdh(x1, x2, out=None)[source]
d2K_dwdw(x1, x2, out=None)[source]
dK_dh(x1, x2, out=None)[source]
dK_dw(x1, x2, out=None)[source]
h = None

Output scale kernel parameter

hessian(x1, x2, out=None)[source]

Hessian of the kernel function evaluated at x1 and x2.

Parameters :

x1 : numpy.ndarray with dtype='f8'

\(n\)-length vector

x2 : numpy.ndarray with dtype='f8'

\(m\)-length vector

Returns :

H : numpy.ndarray

\(n_p\times n_p\times n\times m\) array, where \(n_p\) is the number of kernel parameters. See params.

jacobian(x1, x2, out=None)[source]

Jacobian of the kernel function evaluated at x1 and x2.

Parameters :

x1 : numpy.ndarray with dtype='f8'

\(n\)-length vector

x2 : numpy.ndarray with dtype='f8'

\(m\)-length vector

Returns :

J : numpy.ndarray

\(n_p\times n\times m\) array, where \(n_p\) is the number of kernel parameters. See params.

params[source]

Kernel parameters.

Returns :params : numpy.ndarray (h, w)
set_param(name, val)[source]
sym_K[source]

Symbolic kernel function.

Returns :

K : sympy.Expr

A sympy expression representing the symbolic form of the kernel function.

w = None

Input scale kernel parameter

Previous topic

Kernels

Next topic

Periodic kernel

This Page