class_docstr: The base class for any Gaussian process latent function to be used in conjunction
  with approximate inference (typically stochastic variational inference).
  This base class can be used to implement most inducing point methods where the
  variational parameters are learned directly.
  
  :param ~gpytorch.variational._VariationalStrategy variational_strategy: The strategy that determines
      how the model marginalizes over the variational distribution (over inducing points)
      to produce the approximate posterior distribution (over data)
  
  The :meth:`forward` function should describe how to compute the prior latent distribution
  on a given input. Typically, this will involve a mean and kernel function.
  The result must be a :obj:`~gpytorch.distributions.MultivariateNormal`.
  
  Example:
      >>> class MyVariationalGP(gpytorch.models.PyroGP):
      >>>     def __init__(self, variational_strategy):
      >>>         super().__init__(variational_strategy)
      >>>         self.mean_module = gpytorch.means.ZeroMean()
      >>>         self.covar_module = gpytorch.kernels.ScaleKernel(gpytorch.kernels.RBFKernel())
      >>>
      >>>     def forward(self, x):
      >>>         mean = self.mean_module(x)
      >>>         covar = self.covar_module(x)
      >>>         return gpytorch.distributions.MultivariateNormal(mean, covar)
      >>>
      >>> # variational_strategy = ...
      >>> model = MyVariationalGP(variational_strategy)
      >>> likelihood = gpytorch.likelihoods.GaussianLikelihood()
      >>>
      >>> # optimization loop for variational parameters...
      >>>
      >>> # test_x = ...;
      >>> model(test_x)  # Returns the approximate GP latent function at test_x
      >>> likelihood(model(test_x))  # Returns the (approximate) predictive posterior distribution at test_x
code: def __init__(self, variational_strategy):
      super().__init__()
  
      self.variational_strategy = variational_strategy
  
file_path: gpytorch/gpytorch/models/approximate_gp.py
imports: from typing import Any, Optional
  from torch import Tensor
  from ..distributions import MultivariateNormal
  from .exact_gp import ExactGP
  from .gp import GP
  from .pyro import _PyroMixin
label_desc: Use image node_id 1 to create a new ApproximateGP object from inherited base classes: GP, _PyroMixin with example: obj = ApproximateGP(variational_strategy)