DiagonalKernelComputation#

class gpjax.kernels.DiagonalKernelComputation[source]#

Bases: AbstractKernelComputation

Diagonal kernel computation class. Operations with the kernel assume a diagonal Gram matrix.

gram(kernel, x)[source]#

For a given kernel, compute Gram covariance operator of the kernel function on an input matrix of shape (N, D).

Parameters:
  • kernel (Kernel) – the kernel function.

  • x (Float[jaxlib._jax.Array, 'N D'] | Float[ndarray, 'N D']) – the inputs to the kernel function of shape (N, D).

Returns:

The Gram covariance of the kernel function as a linear operator.

Return type:

AbstractLinearOperator