Skip to content

White

White

White(
    active_dims: list[int] | slice | None = None,
    variance: ScalarFloat | Variable[ScalarArray] = 1.0,
    n_dims: int | None = None,
    compute_engine: AbstractKernelComputation = ConstantDiagonalKernelComputation(),
)

Bases: StationaryKernel

The White noise kernel.

Computes the covariance for pairs of inputs (x,y)(x, y) with variance Οƒ2\sigma^2: k(x,y)=Οƒ2Ξ΄(xβˆ’y) k(x, y) = \sigma^2 \delta(x-y)

Parameters:

  • active_dims (list[int] | slice | None, default: None ) –

    The indices of the input dimensions that the kernel operates on.

  • variance (ScalarFloat | Variable[ScalarArray], default: 1.0 ) –

    the variance of the kernel Οƒ.

  • n_dims (int | None, default: None ) –

    The number of input dimensions.

  • compute_engine (AbstractKernelComputation, default: ConstantDiagonalKernelComputation() ) –

    The computation engine that the kernel uses to compute the covariance matrix

spectral_density property

spectral_density: Normal | StudentT

The spectral density of the kernel.

Returns:

  • Normal | StudentT –

    Callable[[Float[Array, "D"]], Float[Array, "D"]]: The spectral density function.

cross_covariance

cross_covariance(
    x: Num[Array, "N D"], y: Num[Array, "M D"]
) -> Float[Array, "N M"]

Compute the cross-covariance matrix of the kernel.

Parameters:

  • x (Num[Array, 'N D']) –

    the first input matrix of shape (N, D).

  • y (Num[Array, 'M D']) –

    the second input matrix of shape (M, D).

Returns:

  • Float[Array, 'N M'] –

    The cross-covariance matrix of the kernel of shape (N, M).

gram

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

Compute the gram matrix of the kernel.

Parameters:

  • x (Num[Array, 'N D']) –

    the input matrix of shape (N, D).

Returns:

  • LinearOperator –

    The gram matrix of the kernel of shape (N, N).

diagonal

diagonal(x: Num[Array, 'N D']) -> LinearOperator

Compute the diagonal of the gram matrix of the kernel.

Parameters:

  • x (Num[Array, 'N D']) –

    the input matrix of shape (N, D).

Returns:

  • LinearOperator –

    The diagonal of the gram matrix of the kernel of shape (N,).

slice_input

slice_input(
    x: Float[Array, "... D"],
) -> Float[Array, "... Q"]

Slice out the relevant columns of the input matrix.

Select the relevant columns of the supplied matrix to be used within the kernel's evaluation.

Parameters:

  • x (Float[Array, '... D']) –

    the matrix or vector that is to be sliced.

Returns:

  • Float[Array, '... Q'] –

    The sliced form of the input matrix.

__add__

__add__(
    other: Union[AbstractKernel, ScalarFloat],
) -> AbstractKernel

Add two kernels together. Args: other (AbstractKernel): The kernel to be added to the current kernel.

Returns:

  • AbstractKernel ( AbstractKernel ) –

    A new kernel that is the sum of the two kernels.

__mul__

__mul__(
    other: Union[AbstractKernel, ScalarFloat],
) -> AbstractKernel

Multiply two kernels together.

Parameters:

  • other (AbstractKernel) –

    The kernel to be multiplied with the current kernel.

Returns:

  • AbstractKernel ( AbstractKernel ) –

    A new kernel that is the product of the two kernels.