class_docstr: Implements a natural gradient descent optimizer for variational models
  that are based on a distribution q(u) = N(q_mu, q_sqrt q_sqrtᵀ) that is
  parameterized by mean q_mu and lower-triangular Cholesky factor q_sqrt
  of the covariance.
  
  Note that this optimizer does not implement the standard API of
  tf.optimizers.Optimizer. Its only public method is minimize(), which has
  a custom signature (var_list needs to be a list of (q_mu, q_sqrt) tuples,
  where q_mu and q_sqrt are gpflow.Parameter instances, not tf.Variable).
  
  Note furthermore that the natural gradients are implemented only for the
  full covariance case (i.e., q_diag=True is NOT supported).
  
  When using in your work, please cite :cite:t:`salimbeni18`.
class_docstr_tok: ["Implements","a","natural","gradient","descent","optimizer","for","variational","models","that","are","based","on","a","distribution","q","(","u",")","=","N","(","q_mu",",","q_sqrt","q_sqrt\u1d40",")","that","is","parameterized","by","mean","q_mu","and","lower-triangular","Cholesky","factor","q_sqrt","of","the","covariance",".","Note","that","this","optimizer","does","not","implement","the","standard","API","of","tf.optimizers.Optimizer",".","Its","only","public","method","is","minimize","(",")",",","which","has","a","custom","signature","(","var_list","needs","to","be","a","list","of","(","q_mu",",","q_sqrt",")","tuples",",","where","q_mu","and","q_sqrt","are","gpflow.Parameter","instances",",","not","tf.Variable",")",".","Note","furthermore","that","the","natural","gradients","are","implemented","only","for","the","full","covariance","case","(","i.e.",",","q_diag=True","is","NOT","supported",")",".","When","using","in","your","work",",","please","cite",":","cite",":","t",":","`","salimbeni18","`","."]
docstr: Minimizes objective function of the model.
  Natural Gradient optimizer works with variational parameters only.
  
  GPflow implements the `XiNat` (default) and `XiSqrtMeanVar` transformations
  for parameters. Custom transformations that implement the `XiTransform`
  interface are also possible.
  
  :param loss_fn: Loss function.
  :param var_list: List of pair tuples of variational parameters or
      triplet tuple with variational parameters and ξ transformation.
      If ξ is not specified, will use self.xi_transform.
      For example, `var_list` could be::
  
          var_list = [
              (q_mu1, q_sqrt1),
              (q_mu2, q_sqrt2, XiSqrtMeanVar())
          ]
docstr_tok: ["Minimizes","objective","function","of","the","model",".","Natural","Gradient","optimizer","works","with","variational","parameters","only",".","GPflow","implements","the","`","XiNat","`","(","default",")","and","`","XiSqrtMeanVar","`","transformations","for","parameters",".","Custom","transformations","that","implement","the","`","XiTransform","`","interface","are","also","possible",".",":","param","loss_fn",":","Loss","function",".",":","param","var_list",":","List","of","pair","tuples","of","variational","parameters","or","triplet","tuple","with","variational","parameters","and","\u03be","transformation",".","If","\u03be","is","not","specified",",","will","use","self.xi_transform",".","For","example",",","`","var_list","`","could","be",":",":","var_list","=","[","(","q_mu1",",","q_sqrt1",")",",","(","q_mu2",",","q_sqrt2",",","XiSqrtMeanVar","(",")",")","]"]
code: def minimize(
      self,
      loss_fn: LossClosure,
      var_list: Sequence[NatGradParameters],
  ) -> None:
      """
      Minimizes objective function of the model.
      Natural Gradient optimizer works with variational parameters only.
  
      GPflow implements the `XiNat` (default) and `XiSqrtMeanVar` transformations
      for parameters. Custom transformations that implement the `XiTransform`
      interface are also possible.
  
      :param loss_fn: Loss function.
      :param var_list: List of pair tuples of variational parameters or
          triplet tuple with variational parameters and ξ transformation.
          If ξ is not specified, will use self.xi_transform.
          For example, `var_list` could be::
  
              var_list = [
                  (q_mu1, q_sqrt1),
                  (q_mu2, q_sqrt2, XiSqrtMeanVar())
              ]
      """
      parameters = [(v[0], v[1], (v[2] if len(v) > 2 else None)) for v in var_list]  # type: ignore[misc]
      self._natgrad_steps(loss_fn, parameters)
  
imports: import abc
  import functools
  from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Union
  import tensorflow
  from check_shapes import check_shapes
  from ..base import AnyNDArray, Parameter, _to_constrained
label_desc: Use image node_id 2 for calling the NaturalGradient obj's underlying member method code with example usage: obj.minimize(loss_fn, var_list) without return types