def _conditional(Xnew, feat, kern, f, *, full_cov=False, full_output_cov=False, q_sqrt=None, white=False):
    """
    Multi-output GP with independent GP priors.
    Number of latent processes equals the number of outputs (L = P).

    The covariance matrices used to calculate the conditional have the following shape:
    - Kuu: P x M x M
    - Kuf: P x M x N
    - Kff: P x N or P x N x N

    Further reference
    -----------------
    - See `gpflow.conditionals._conditional` for a detailed explanation of
      conditional in the single-output case.
    - See the multiouput notebook for more information about the multiouput framework.
    - See above for the parameters and the return value.
    """

    logger.debug("conditional: object, SharedIndependentMof, SeparateIndependentMok, object")
    # Following are: P x M x M  -  P x M x N  -  P x N(x N)
    Kmms = Kuu(feat, kern, jitter=settings.numerics.jitter_level)  # P x M x M
    Kmns = Kuf(feat, kern, Xnew)  # P x M x N
    kern_list = kern.kernels if isinstance(kern, Combination) else [kern.kern] * len(feat.feat_list)
    Knns = tf.stack([k.K(Xnew) if full_cov else k.Kdiag(Xnew) for k in kern_list], axis=0)
    fs = tf.transpose(f)[:, :, None]  # P x M x 1
    # P x 1 x M x M  or  P x M x 1
    q_sqrts = tf.transpose(q_sqrt)[:, :, None] if q_sqrt.shape.ndims == 2 else q_sqrt[:, None, :, :]

    def single_gp_conditional(t):
        Kmm, Kmn, Knn, f, q_sqrt = t
        return base_conditional(Kmn, Kmm, Knn, f, full_cov=full_cov, q_sqrt=q_sqrt, white=white)

    rmu, rvar = tf.map_fn(single_gp_conditional,
                          (Kmms, Kmns, Knns, fs, q_sqrts),
                          (settings.float_type, settings.float_type))  # P x N x 1, P x 1 x N x N or P x N x 1

    fmu = _rollaxis_left(rmu[..., 0], 1)  # N x P

    if full_cov:
        fvar = rvar[..., 0, :, :]  # P x N x N
    else:
        fvar = _rollaxis_left(rvar[..., 0], 1)  # N x P

    return fmu, _expand_independent_outputs(fvar, full_cov, full_output_cov)
def _conditional ( Xnew , feat , kern , f , * , full_cov = False , full_output_cov = False , q_sqrt = None , white = False ) : logger . debug ( "conditional: object, SharedIndependentMof, SeparateIndependentMok, object" ) Kmms = Kuu ( feat , kern , jitter = settings . numerics . jitter_level ) Kmns = Kuf ( feat , kern , Xnew ) kern_list = kern . kernels if isinstance ( kern , Combination ) else [ kern . kern ] * len ( feat . feat_list ) Knns = tf . stack ( [ k . K ( Xnew ) if full_cov else k . Kdiag ( Xnew ) for k in kern_list ] , axis = 0 ) fs = tf . transpose ( f ) [ : , : , None ] q_sqrts = tf . transpose ( q_sqrt ) [ : , : , None ] if q_sqrt . shape . ndims == 2 else q_sqrt [ : , None , : , : ] def single_gp_conditional ( t ) : Kmm , Kmn , Knn , f , q_sqrt = t return base_conditional ( Kmn , Kmm , Knn , f , full_cov = full_cov , q_sqrt = q_sqrt , white = white ) rmu , rvar = tf . map_fn ( single_gp_conditional , ( Kmms , Kmns , Knns , fs , q_sqrts ) , ( settings . float_type , settings . float_type ) ) fmu = _rollaxis_left ( rmu [ ... , 0 ] , 1 ) if full_cov : fvar = rvar [ ... , 0 , : , : ] else : fvar = _rollaxis_left ( rvar [ ... , 0 ] , 1 ) return fmu , _expand_independent_outputs ( fvar , full_cov , full_output_cov )
Multi-output GP with independent GP priors.
    Number of latent processes equals the number of outputs (L = P).

    The covariance matrices used to calculate the conditional have the following shape:
    - Kuu: P x M x M
    - Kuf: P x M x N
    - Kff: P x N or P x N x N

    Further reference
    -----------------
    - See `gpflow.conditionals._conditional` for a detailed explanation of
      conditional in the single-output case.
    - See the multiouput notebook for more information about the multiouput framework.
    - See above for the parameters and the return value.