Diagonal
gpjax.kernels.computations.diagonal
Kernel = tp.TypeVar('Kernel', bound='gpjax.kernels.base.AbstractKernel')
module-attribute
DiagonalKernelComputation
Bases: AbstractKernelComputation
Diagonal kernel computation class. Operations with the kernel assume a diagonal Gram matrix.
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.
gram(kernel: Kernel, x: Float[Array, 'N D']) -> LinearOperator
Compute the Gram matrix.
For a kernel with diagonal structure, compute the Gram matrix on an input matrix of shape .
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kernel |
Kernel
|
the kernel function. |
required |
x |
Float[Array, 'N D']
|
The input matrix. |
required |
Returns
LinearOperator: The computed square Gram matrix.
cross_covariance(kernel: Kernel, x: Float[Array, 'N D'], y: Float[Array, 'M D']) -> Float[Array, 'N M']
Compute the cross-covariance matrix.
For a given kernel, compute the covariance matrix on a pair of input matrices of shape and .
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kernel |
Kernel
|
the kernel function. |
required |
x |
Float[Array, 'N D']
|
The input matrix. |
required |
y |
Float[Array, 'M D']
|
The input matrix. |
required |
Returns
Float[Array, "N M"]: The computed cross-covariance.