Skip to content

Eigen

gpjax.kernels.computations.eigen

Kernel = tp.TypeVar('Kernel', bound='gpjax.kernels.base.AbstractKernel') module-attribute
EigenKernelComputation dataclass

Bases: AbstractKernelComputation

Eigen kernel computation class. Kernels who operate on an eigen-decomposed structure should use this computation object.

gram(kernel: Kernel, x: Num[Array, 'N D']) -> LinearOperator

Compute Gram covariance operator of the kernel function.

Parameters:

Name Type Description Default
kernel AbstractKernel

the kernel function.

required
x Num[Array, 'N N']

The inputs to the kernel function.

required
Returns
LinearOperator: Gram covariance operator of the kernel function.
diagonal(kernel: Kernel, inputs: Num[Array, 'N D']) -> Diagonal

For a given kernel, compute the elementwise diagonal of the NxN gram matrix on an input matrix of shape NxD.

Parameters:

Name Type Description Default
kernel AbstractKernel

the kernel function.

required
inputs Float[Array, 'N D']

The input matrix.

required
Returns
Diagonal: The computed diagonal variance entries.
__init__() -> None
cross_covariance(kernel: Kernel, x: Num[Array, 'N D'], y: Num[Array, 'M D']) -> Float[Array, 'N M']

Compute the cross-covariance matrix.

For an NΓ—DN\times D and MΓ—DM\times D pair of matrices, evaluate the NΓ—MN \times M cross-covariance matrix.

Parameters:

Name Type Description Default
kernel Kernel

the kernel function.

required
x Num[Array, 'N D']

The input matrix.

required
y Num[Array, 'M D']

The input matrix.

required

Returns:

Name Type Description
_type_ Float[Array, 'N M']

description