class_docstr_tok: []
docstr: Implements the "reverse-mode" gradient [#]_ for the
  Cholesky factorization of a positive-definite matrix.
  
  References
  ----------
  .. [#] S. P. Smith. "Differentiation of the Cholesky Algorithm".
     Journal of Computational and Graphical Statistics,
     Vol. 4, No. 2 (Jun.,1995), pp. 134-147
     http://www.jstor.org/stable/1390762
code: def perform(self, node, inputs, outputs):
      """
      Implements the "reverse-mode" gradient [#]_ for the
      Cholesky factorization of a positive-definite matrix.
  
      References
      ----------
      .. [#] S. P. Smith. "Differentiation of the Cholesky Algorithm".
         Journal of Computational and Graphical Statistics,
         Vol. 4, No. 2 (Jun.,1995), pp. 134-147
         http://www.jstor.org/stable/1390762
  
      """
      x = inputs[0]
      L = inputs[1]
      dz = inputs[2]
      dx = outputs[0]
      N = x.shape[0]
      if self.lower:
          F = np.tril(dz)
          for k in xrange(N - 1, -1, -1):
              for j in xrange(k + 1, N):
                  for i in xrange(j, N):
                      F[i, k] -= F[i, j] * L[j, k]
                      F[j, k] -= F[i, j] * L[i, k]
              for j in xrange(k + 1, N):
                  F[j, k] /= L[k, k]
                  F[k, k] -= L[j, k] * F[j, k]
              F[k, k] /= 2 * L[k, k]
      else:
          F = np.triu(dz)
          for k in xrange(N - 1, -1, -1):
              for j in xrange(k + 1, N):
                  for i in xrange(j, N):
                      F[k, i] -= F[j, i] * L[k, j]
                      F[k, j] -= F[j, i] * L[k, i]
              for j in xrange(k + 1, N):
                  F[k, j] /= L[k, k]
                  F[k, k] -= L[k, j] * F[k, j]
              F[k, k] /= 2 * L[k, k]
      dx[0] = F
  
imports: from __future__ import absolute_import, print_function, division
  import logging
  import warnings
  from six.moves import xrange
  import numpy
  from theano import tensor
  import theano.tensor
  from theano.tensor import as_tensor_variable
  from theano.gof import Op, Apply
label_desc: Use image node_id 3 for calling the CholeskyGrad obj's underlying member method code with example usage: obj.perform(node, inputs, outputs) without return types