Skip to content

Kernels

Kernel functions for use in evolutionary algorithms.

Kernels have the signature (x, y, params) -> similarity and are used by the Stein Variational Evolution Strategies to couple their search distributions.

RBFKernelParams

Bases: Protocol

Parameters required by the RBF kernel.

kernel_rbf

kernel_rbf(x: Array, y: Array, params: RBFKernelParams) -> jax.Array

Radial basis function kernel.

Computes exp(-0.5 * sum(((x - y) / params.kernel_std) ** 2)).

Parameters:

  • x (Array) –

    First point.

  • y (Array) –

    Second point.

  • params (RBFKernelParams) –

    Hyperparameters with a kernel_std field, the kernel bandwidth.

Returns:

  • Array –

    The kernel value, a scalar for vector inputs.