AbstractVariationalFamily#

class gpjax.variational_families.AbstractVariationalFamily(model)[source]#

Bases: _SummaryMixin, Module, Generic[L]

Abstract base class used to represent families of distributions that can be used within variational inference.

A variational family is a trainable approximate posterior over inducing values: it is to sparse GPs what JointModel is to exact ones. Conditioning an already-fit family yields a Posterior like any other.

Parameters:

model (JointModel)

abstractmethod condition(train_data)[source]#

Condition the family, yielding its posterior process.

The signature is the one every conditionable object in GPJax shares: condition(train_data), with model | D as sugar. Families whose approximate posterior is already carried internally accept train_data for that uniformity and ignore it; the collapsed family, whose optimal \(q(u)\) is solved from the data, consumes it.

Parameters:

train_data (Dataset) – The training data to condition on.

Returns:

The conditioned process, queried as

q.condition(train_data)(test_inputs).

Return type:

Posterior

abstractmethod predict(*args, **kwargs)[source]#

Predict the GP’s output given the input.

Parameters:
  • *args (Any) – Arguments of the variational family’s predict method.

  • **kwargs (Any) – Keyword arguments of the variational family’s predict method.

Returns:

The output of the variational family’s predict method.

Return type:

GaussianDistribution

abstractmethod prior_kl(*args, **kwargs)[source]#

The KL divergence from the variational distribution to the prior.

Every ELBO-style objective subtracts this term, so each concrete family must provide it.

Returns:

The KL divergence.

Return type:

ScalarFloat

Parameters: