BasisFunctionComputation#
- class gpjax.kernels.BasisFunctionComputation[source]#
Bases:
AbstractKernelComputationCompute engine class for finite basis function approximations to a kernel.
- compute_features(kernel, x)[source]#
Compute the features for the inputs.
- Parameters:
kernel (K) – 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:
A matrix of shape \(N \times L\) representing the random fourier features where \(L = 2M\).
- Return type:
Float[jaxlib._jax.Array, ‘N L’] | Float[ndarray, ‘N L’]
- diagonal(kernel, inputs)[source]#
For a given kernel, compute the elementwise diagonal of the NxN gram matrix on an input matrix of shape NxD.
- Parameters:
kernel (AbstractKernel) – the kernel function.
inputs (Float[Array, "N D"]) – The input matrix.
- Returns:
The computed diagonal variance entries.
- Return type:
Diagonal