class_docstr: A multivariate normal :obj:`~gpytorch.variational._VariationalDistribution`,
  parameterized by the natural vector, and a triangular decomposition of the
  natural matrix (which is not the Cholesky).
  
  .. note::
     The :obj:`~gpytorch.variational.TrilNaturalVariationalDistribution` should only
     be used with :obj:`gpytorch.optim.NGD`, or other optimizers
     that follow exactly the gradient direction.
  
  .. seealso::
      The `natural gradient descent tutorial
      <examples/04_Variational_and_Approximate_GPs/Natural_Gradient_Descent.ipynb>`_
      for use instructions.
  
      The :obj:`~gpytorch.variational.NaturalVariationalDistribution`, which
      needs less iterations to make variational regression converge, at the
      cost of introducing numerical instability.
  
  .. note::
      The relationship of the parameter :math:`\mathbf \Theta_\text{tril_mat}`
      to the natural parameter :math:`\mathbf \Theta_\text{mat}` from
      :obj:`~gpytorch.variational.NaturalVariationalDistribution` is
      :math:`\mathbf \Theta_\text{mat} = -1/2 {\mathbf \Theta_\text{tril_mat}}^T {\mathbf \Theta_\text{tril_mat}}`.
      Note that this is not the form of the Cholesky decomposition of :math:`\boldsymbol \Theta_\text{mat}`.
  
  :param int num_inducing_points: Size of the variational distribution. This implies that the variational mean
      should be this size, and the variational covariance matrix should have this many rows and columns.
  :param batch_shape: Specifies an optional batch size
      for the variational parameters. This is useful for example when doing additive variational inference.
  :type batch_shape: :obj:`torch.Size`, optional
  :param float mean_init_std: (Default: 1e-3) Standard deviation of gaussian noise to add to the mean initialization.
class_docstr_tok: ["A","multivariate","normal",":","obj",":","`","~gpytorch.variational._VariationalDistribution","`",",","parameterized","by","the","natural","vector",",","and","a","triangular","decomposition","of","the","natural","matrix","(","which","is","not","the","Cholesky",")",".","..","note",":",":","The",":","obj",":","`","~gpytorch.variational.TrilNaturalVariationalDistribution","`","should","only","be","used","with",":","obj",":","`","gpytorch.optim.NGD","`",",","or","other","optimizers","that","follow","exactly","the","gradient","direction",".","..","seealso",":",":","The","`","natural","gradient","descent","tutorial","<","examples\/04_Variational_and_Approximate_GPs\/Natural_Gradient_Descent.ipynb",">","`","_","for","use","instructions",".","The",":","obj",":","`","~gpytorch.variational.NaturalVariationalDistribution","`",",","which","needs","less","iterations","to","make","variational","regression","converge",",","at","the","cost","of","introducing","numerical","instability",".","..","note",":",":","The","relationship","of","the","parameter",":","math",":","`","\\mathbf","\\Theta_\\text","{","tril_mat","}","`","to","the","natural","parameter",":","math",":","`","\\mathbf","\\Theta_\\text","{","mat","}","`","from",":","obj",":","`","~gpytorch.variational.NaturalVariationalDistribution","`","is",":","math",":","`","\\mathbf","\\Theta_\\text","{","mat","}","=","-1\/2","{","\\mathbf","\\Theta_\\text","{","tril_mat","}","}","^T","{","\\mathbf","\\Theta_\\text","{","tril_mat","}","}","`",".","Note","that","this","is","not","the","form","of","the","Cholesky","decomposition","of",":","math",":","`","\\boldsymbol","\\Theta_\\text","{","mat","}","`",".",":","param","int","num_inducing_points",":","Size","of","the","variational","distribution",".","This","implies","that","the","variational","mean","should","be","this","size",",","and","the","variational","covariance","matrix","should","have","this","many","rows","and","columns",".",":","param","batch_shape",":","Specifies","an","optional","batch","size","for","the","variational","parameters",".","This","is","useful","for","example","when","doing","additive","variational","inference",".",":","type","batch_shape",":",":","obj",":","`","torch.Size","`",",","optional",":","param","float","mean_init_std",":","(","Default",":","1e-3",")","Standard","deviation","of","gaussian","noise","to","add","to","the","mean","initialization","."]
code: def initialize_variational_distribution(
      self, prior_dist: MultivariateNormal
  ) -> None:
      prior_cov = prior_dist.lazy_covariance_matrix
      chol = prior_cov.cholesky().to_dense()
      tril_mat = _triangular_inverse(chol, upper=False)
  
      natural_vec = prior_cov.solve(
          prior_dist.mean.unsqueeze(-1)
      ).squeeze(-1)
      noise = torch.randn_like(natural_vec).mul_(self.mean_init_std)
  
      self.natural_vec.data.copy_(natural_vec.add_(noise))
      self.natural_tril_mat.data.copy_(tril_mat)
  
file_path: gpytorch/gpytorch/variational/tril_natural_variational_distribution.py
imports: from typing import Tuple
  import torch
  from linear_operator.operators import CholLinearOperator, TriangularLinearOperator
  from torch import Tensor
  from torch.autograd.function import FunctionCtx
  from ..distributions import Distribution, MultivariateNormal
  from .natural_variational_distribution import _NaturalToMuVarSqrt, _NaturalVariationalDistribution, _phi_for_cholesky_, _triangular_inverse
label_desc: Use image node_id 3 for calling the TrilNaturalVariationalDistribution obj's underlying member method code with example usage: obj.initialize_variational_distribution(prior_dist) without return types