gpflux.sampling.utils#
This module contains utilities for sampling from multivariate Gaussian distributions.
Module Contents#
- _cholesky_with_jitter(cov: gpflow.base.TensorType) tf.Tensor [source]#
Compute the Cholesky of the covariance, adding jitter (determined by
gpflow.default_jitter()
) to the diagonal to improve stability.- Parameters:
cov – full covariance with shape
[..., N, D, D]
.
- draw_conditional_sample(mean: gpflow.base.TensorType, cov: gpflow.base.TensorType, f_old: gpflow.base.TensorType) tf.Tensor [source]#
Draw a sample
from the conditional multivariate Gaussian , where the parametersmean
andcov
are the mean and covariance matrix of the joint multivariate Gaussian over .- Parameters:
mean –
A tensor with the shape
[..., D, N+M]
with the mean of[f_old, f_new]
. For each[..., D]
this is a stacked vector of the form:cov –
A tensor with the shape
[..., D, N+M, N+M]
with the covariance of[f_old, f_new]
. For each[..., D]
, there is a 2x2 block matrix of the form:f_old – A tensor of observations with the shape
[..., D, N]
, drawn from Normal distribution with mean , and covariance
- Returns:
A sample
from the conditional normal with the shape[..., D, M]
.