docstr: Compute the mean and variance of the latent function at some new points.
  Note that this is very similar to the SGPR prediction, for which
  there are notes in the SGPR notebook.
  
  Note: This model does not allow full output covariances.
  
  :param Xnew: points at which to predict
docstr_tok: ["Compute","the","mean","and","variance","of","the","latent","function","at","some","new","points",".","Note","that","this","is","very","similar","to","the","SGPR","prediction",",","for","which","there","are","notes","in","the","SGPR","notebook",".","Note",":","This","model","does","not","allow","full","output","covariances",".",":","param","Xnew",":","points","at","which","to","predict"]
code: def predict_f(
      self,
      Xnew: InputData,
      full_cov: bool = False,
      full_output_cov: bool = False,
  ) -> MeanAndVariance:
      """
      Compute the mean and variance of the latent function at some new points.
      Note that this is very similar to the SGPR prediction, for which
      there are notes in the SGPR notebook.
  
      Note: This model does not allow full output covariances.
  
      :param Xnew: points at which to predict
      """
      assert_params_false(
          self.predict_f, full_output_cov=full_output_cov
      )
  
      pX = DiagonalGaussian(self.X_data_mean, self.X_data_var)
  
      Y_data = self.data
      num_inducing = self.inducing_variable.num_inducing
      psi1 = expectation(pX, (self.kernel, self.inducing_variable))
      psi2 = tf.reduce_sum(
          expectation(
              pX,
              (self.kernel, self.inducing_variable),
              (self.kernel, self.inducing_variable),
          ),
          axis=0,
      )
      jitter = default_jitter()
      Kus = covariances.Kuf(self.inducing_variable, self.kernel, Xnew)
      sigma2 = self.likelihood.variance
      L = tf.linalg.cholesky(
          covariances.Kuu(
              self.inducing_variable, self.kernel, jitter=jitter
          )
      )
  
      A = tf.linalg.triangular_solve(L, tf.transpose(psi1), lower=True)
      tmp = tf.linalg.triangular_solve(L, psi2, lower=True)
      AAT = (
          tf.linalg.triangular_solve(L, tf.transpose(tmp), lower=True)
          / sigma2
      )
      B = AAT + tf.eye(num_inducing, dtype=default_float())
      LB = tf.linalg.cholesky(B)
      c = (
          tf.linalg.triangular_solve(
              LB, tf.linalg.matmul(A, Y_data), lower=True
          )
          / sigma2
      )
      tmp1 = tf.linalg.triangular_solve(L, Kus, lower=True)
      tmp2 = tf.linalg.triangular_solve(LB, tmp1, lower=True)
      mean = tf.linalg.matmul(tmp2, c, transpose_a=True)
      if full_cov:
          var = (
              self.kernel(Xnew)
              + tf.linalg.matmul(tmp2, tmp2, transpose_a=True)
              - tf.linalg.matmul(tmp1, tmp1, transpose_a=True)
          )
          shape = tf.stack([tf.shape(Y_data)[1], 1, 1])
          var = tf.tile(tf.expand_dims(var, 0), shape)
      else:
          var = (
              self.kernel(Xnew, full_cov=False)
              + tf.reduce_sum(tf.square(tmp2), axis=0)
              - tf.reduce_sum(tf.square(tmp1), axis=0)
          )
          shape = tf.stack([1, tf.shape(Y_data)[1]])
          var = tf.tile(tf.expand_dims(var, 1), shape)
      return mean + self.mean_function(Xnew), var
  
imports: from typing import Optional
  import numpy
  import tensorflow
  from check_shapes import check_shapes, inherit_check_shapes
  from ..None import covariances, kernels, likelihoods
  from ..base import InputData, MeanAndVariance, OutputData, Parameter, RegressionData, TensorType
  from ..config import default_float, default_jitter
  from ..expectations import expectation
  from ..inducing_variables import InducingPoints
  from ..kernels import Kernel
  from ..mean_functions import MeanFunction, Zero
  from ..probability_distributions import DiagonalGaussian
  from ..utilities import assert_params_false, positive, to_default_float
  from ..utilities.ops import pca_reduce
  from .gpr import GPR
  from .model import GPModel
  from .training_mixins import InternalDataTrainingLossMixin
  from .util import InducingVariablesLike, data_input_to_tensor, inducingpoint_wrapper
label_desc: Use image node_id 4 for calling the BayesianGPLVM obj's underlying member method code with example usage: obj.predict_f(Xnew, full_cov, full_output_cov) and returns: unknown,  var