WhitenedVariationalGaussian#

class gpjax.variational_families.WhitenedVariationalGaussian(model, inducing_inputs, variational_mean=None, variational_root_covariance=None)[source]#

Bases: VariationalGaussian[L]

The whitened variational Gaussian family of probability distributions.

The variational family is \(q(f(\cdot)) = \int p(f(\cdot)\mid u) q(u) \mathrm{d}u\), where \(u = f(z)\) are the function values at the inducing inputs \(z\) and the distribution over the inducing inputs is \(q(u) = \mathcal{N}(Lz \mu + mz, Lz S Lz^{\top})\). We parameterise this over \(\mu\) and \(sqrt\) with \(S = sqrt sqrt^{\top}\).

Expand for references to gpjax.variational_families.WhitenedVariationalGaussian

Natural Gradients

Parameters:
  • model (JointModel)

  • inducing_inputs (Any)

  • variational_mean (Any)

  • variational_root_covariance (Any)

condition(train_data)[source]#

Condition the family, yielding its posterior process.

Identical to VariationalGaussian.condition()train_data is likewise accepted for interface uniformity and not used — except that the stored moments parameterise the whitened distribution \(q(u) = \mathcal{N}(\mathbf{L}_z\mu + \mu_z, \mathbf{L}_z S \mathbf{L}_z^{\top})\), which the returned posterior de-whitens at query time.

Parameters:

train_data (Dataset | None) – Accepted for interface uniformity and ignored; the fitted \(q(u)\) already summarises the data.

Returns:

The conditioned sparse posterior process.

Return type:

SparsePosterior

prior_kl()[source]#

Compute the KL-divergence between our variational approximation and the Gaussian process prior.

For this variational family, we have

\[\begin{split}\begin{aligned} \operatorname{KL}[q(f(\cdot))\mid\mid p(\cdot)] & = \operatorname{KL}[q(u)\mid\mid p(u)]\\ & = \operatorname{KL}[N(\mu , S)\mid\mid N(0, I)]. \end{aligned}\end{split}\]

Against a standard normal prior the divergence has a closed form that needs no matrix factorisation at all. Writing \(S = LL^{\top}\) for the stored triangular root \(L\), and using \(\operatorname{tr}[S] = \lVert L\rVert_F^2\) and \(\log\lvert S\rvert = 2\sum_i \log\lvert L_{ii}\rvert\),

\[\operatorname{KL}[\mathcal{N}(\mu, S)\mid\mid\mathcal{N}(0, I)] = \tfrac{1}{2}\left( \lVert\mu\rVert^2 + \lVert L\rVert_F^2 - m - 2\sum_i \log\lvert L_{ii}\rvert \right),\]

where \(m\) is the number of inducing points.

Returns:

The KL-divergence between our variational

approximation and the GP prior.

Return type:

ScalarFloat