gpflow.conditionals.util

gpflow.conditionals.util.fully_correlated_conditional_repeat

gpflow.conditionals.util.fully_correlated_conditional_repeat(Kmn, Kmm, Knn, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False)[source]

This function handles conditioning of multi-output GPs in the case where the conditioning points are all fully correlated, in both the prior and posterior. Note: This conditional can handle ‘repetitions’ R, given in f and q_sqrt. :type Kmn: Tensor :param Kmn: [M, N, P] :type Kmm: Tensor :param Kmm: [M, M] :type Knn: Tensor :param Knn: [N, P] or [N, P, P] or [P, N, N] or [N, P, N, P] :type f: Tensor :param f: data matrix, [M, R] :type q_sqrt: Optional[Tensor] :param q_sqrt: [R, M, M] or [M, R] :type full_cov: bool :param full_cov: calculate covariance between inputs :type full_output_cov: bool :param full_output_cov: calculate covariance between outputs :type white: bool :param white: use whitened representation :rtype: Tuple[Tensor, Tensor] :return:

  • mean: [R, N, P]

  • variance: [R, N, P], [R, N, P, P], [R, P, N, N], [R, N, P, N, P]

gpflow.conditionals.util.rollaxis_left

gpflow.conditionals.util.rollaxis_left(A, num_rolls)[source]

Roll the tensor A backwards num_rolls times.

Parameters
  • A (Tensor) –

  • num_rolls (int) –

Return type

Tensor

gpflow.conditionals.util.rollaxis_right

gpflow.conditionals.util.rollaxis_right(A, num_rolls)[source]

Roll the tensor A forward num_rolls times.

Parameters
  • A (Tensor) –

  • num_rolls (int) –

Return type

Tensor

gpflow.conditionals.util.sample_mvn

gpflow.conditionals.util.sample_mvn(mean, cov, full_cov, num_samples=None)[source]

Returns a sample from a D-dimensional Multivariate Normal distribution :type mean: Tensor :param mean: […, N, D] :type cov: Tensor :param cov: […, N, D] or […, N, D, D] :type full_cov: bool :param full_cov: if True return a “full” covariance matrix, otherwise a “diag”: - “full”: cov holds the full covariance matrix (without jitter) - “diag”: cov holds the diagonal elements of the covariance matrix :rtype: Tensor :return: sample from the MVN of shape […, (S), N, D], S = num_samples

Parameters

num_samples (Optional[int]) –