CollapsedVariationalGaussian#
- class gpjax.variational_families.CollapsedVariationalGaussian(model, inducing_inputs)[source]#
Bases:
AbstractVariationalGaussian[GL]Collapsed variational Gaussian.
Collapsed variational Gaussian family of probability distributions. The key reference is Titsias, (2009) - Variational Learning of Inducing Variables in Sparse Gaussian Processes.
The bound is collapsed: the variational parameters are solved for analytically, which requires a Gaussian likelihood and a pass over the full dataset. Lift either restriction and you need the uncollapsed bound of
VariationalGaussianinstead.See also
Sparse Gaussian Process Regression works through the sparse regression setting this family is designed for.
- Parameters:
model (JointModel)
inducing_inputs (Any)
- condition(train_data)[source]#
Condition the family on data, yielding its posterior process.
Unlike the uncollapsed families, the optimal variational distribution here is a function of the data, so conditioning takes the training set — exactly as
model.condition(train_data)does for a joint model. The returnedCollapsedPosteriorcaches its factorisations; the predictive and the Titsias bound (elbo_bound) are views of them.- Parameters:
train_data (Dataset) – The training data the optimal variational distribution is solved against.
- Returns:
The conditioned collapsed posterior process.
- Return type:
CollapsedPosterior
- predict(test_inputs, train_data)[source]#
Compute the predictive distribution of the GP at the test inputs.
Sugar for
self.condition(train_data)(test_inputs).- Parameters:
test_inputs (Float[Array, "N D"]) – The test inputs \(t\) at which to make predictions.
train_data (Dataset) – The training data that was used to fit the GP.
- Returns:
- The predictive distribution of the collapsed
variational Gaussian process at the test inputs \(t\).
- Return type:
- prior_kl(train_data)[source]#
KL divergence from the optimal collapsed \(q^{\star}(u)\) to the prior.
The collapsed family’s variational distribution is solved analytically from the data, so — unlike the uncollapsed families — its KL is a function of the training set. Sugar for
self.condition(train_data).prior_kl.- Parameters:
train_data (Dataset) – The training data the optimal variational distribution is solved against.
- Returns:
- The KL divergence of the optimal collapsed
variational distribution from the prior.
- Return type: