SVGDKernel

phasic.svgd.SVGDKernel(bandwidth='median_per_dim', preconditioner=None)

RBF kernel for SVGD with automatic bandwidth selection.

Parameters

bandwidth : str or float or jnp.ndarray = 'median_per_dim'

Bandwidth selection method or fixed value.

preconditioner : _PreconditionerBase or None = None

Optional preconditioner for normalizing particle space.

Methods

Name Description
compute_kernel_grad Compute RBF kernel matrix and its gradient (JIT-compiled)

compute_kernel_grad

phasic.svgd.SVGDKernel.compute_kernel_grad(particles)

Compute RBF kernel matrix and its gradient (JIT-compiled)

Parameters

particles : jnp.ndarray

Current particle positions, shape (n_particles, theta_dim).

Returns

K : jnp.ndarray

Kernel matrix, shape (n_particles, n_particles).

grad_K : jnp.ndarray

Gradient of kernel matrix w.r.t. original (unnormalized) particles, shape (n_particles, n_particles, theta_dim).