class_docstr: Variational Sparse Gaussian Process model.
  
  In :class:`.VariationalGP` model, when the number of input data :math:`X` is large,
  the covariance matrix :math:`k(X, X)` will require a lot of computational steps to
  compute its inverse (for log likelihood and for prediction). This model introduces
  an additional inducing-input parameter :math:`X_u` to solve that problem. Given
  inputs :math:`X`, their noisy observations :math:`y`, and the inducing-input
  parameters :math:`X_u`, the model takes the form:
  
  .. math::
      [f, u] &\sim \mathcal{GP}(0, k([X, X_u], [X, X_u])),\\
      y & \sim p(y) = p(y \mid f) p(f),
  
  where :math:`p(y \mid f)` is the likelihood.
  
  We will use a variational approach in this model by approximating :math:`q(f,u)`
  to the posterior :math:`p(f,u \mid y)`. Precisely, :math:`q(f) = p(f\mid u)q(u)`,
  where :math:`q(u)` is a multivariate normal distribution with two parameters
  ``u_loc`` and ``u_scale_tril``, which will be learned during a variational
  inference process.
  
  .. note:: This model can be learned using MCMC method as in reference [2]. See also
      :class:`.GPModel`.
  
  .. note:: This model has :math:`\mathcal{O}(NM^2)` complexity for training,
      :math:`\mathcal{O}(M^3)` complexity for testing. Here, :math:`N` is the number
      of train inputs, :math:`M` is the number of inducing inputs. Size of
      variational parameters is :math:`\mathcal{O}(M^2)`.
  
  References:
  
  [1] `Scalable variational Gaussian process classification`,
  James Hensman, Alexander G. de G. Matthews, Zoubin Ghahramani
  
  [2] `MCMC for Variationally Sparse Gaussian Processes`,
  James Hensman, Alexander G. de G. Matthews, Maurizio Filippone, Zoubin Ghahramani
  
  :param torch.Tensor X: A input data for training. Its first dimension is the number
      of data points.
  :param torch.Tensor y: An output data for training. Its last dimension is the
      number of data points.
  :param ~pyro.contrib.gp.kernels.kernel.Kernel kernel: A Pyro kernel object, which
      is the covariance function :math:`k`.
  :param torch.Tensor Xu: Initial values for inducing points, which are parameters
      of our model.
  :param ~pyro.contrib.gp.likelihoods.likelihood Likelihood likelihood: A likelihood
      object.
  :param callable mean_function: An optional mean function :math:`m` of this Gaussian
      process. By default, we use zero mean.
  :param torch.Size latent_shape: Shape for latent processes (`batch_shape` of
      :math:`q(u)`). By default, it equals to output batch shape ``y.shape[:-1]``.
      For the multi-class classification problems, ``latent_shape[-1]`` should
      corresponse to the number of classes.
  :param int num_data: The size of full training dataset. It is useful for training
      this model with mini-batch.
  :param bool whiten: A flag to tell if variational parameters ``u_loc`` and
      ``u_scale_tril`` are transformed by the inverse of ``Luu``, where ``Luu`` is
      the lower triangular decomposition of :math:`kernel(X_u, X_u)`. Enable this
      flag will help optimization.
  :param float jitter: A small positive term which is added into the diagonal part of
      a covariance matrix to help stablize its Cholesky decomposition.
code: def guide(self):
      self.set_mode("guide")
      self._load_pyro_samples()
  
      pyro.sample(
          self._pyro_get_fullname("u"),
          dist.MultivariateNormal(
              self.u_loc, scale_tril=self.u_scale_tril
          ).to_event(self.u_loc.dim() - 1),
      )
  
file_path: pyro/pyro/contrib/gp/models/vsgp.py
imports: import torch
  from torch.distributions import constraints
  from torch.nn import Parameter
  import pyro
  import pyro.distributions
  import pyro.poutine
  from pyro.contrib.gp.models.model import GPModel
  from pyro.contrib.gp.util import conditional
  from pyro.distributions.util import eye_like
  from pyro.nn.module import PyroParam, pyro_method
label_desc: Use image node_id 3 for calling the VariationalSparseGP obj's underlying member method code with example usage: obj.guide() without return types