class_docstr: Maps the Cholesky factor of `M` to the Cholesky factor of `M^{-1}`.
  
  The `forward` and `inverse` calculations are conceptually identical to:
  
  ```python
  def forward(x):
    return tf.linalg.cholesky(tf.linalg.inv(tf.matmul(x, x, adjoint_b=True)))
  
  inverse = forward
  ```
  
  or, similarly,
  
  ```python
  tfb = tfp.bijectors
  CholeskyToInvCholesky = tfb.Chain([
      tfb.Invert(tfb.CholeskyOuterProduct()),
      tfb.MatrixInverse(),
      tfb.CholeskyOuterProduct(),
  ])
  ```
  
  However, the actual calculations exploit the triangular structure of the
  matrices.
class_docstr_tok: ["Maps","the","Cholesky","factor","of","`","M","`","to","the","Cholesky","factor","of","`","M^","{","-1","}","`",".","The","`","forward","`","and","`","inverse","`","calculations","are","conceptually","identical","to",":","``","`","python","def","forward","(","x",")",":","return","tf.linalg.cholesky","(","tf.linalg.inv","(","tf.matmul","(","x",",","x",",","adjoint_b=True",")",")",")","inverse","=","forward","``","`","or",",","similarly",",","``","`","python","tfb","=","tfp.bijectors","CholeskyToInvCholesky","=","tfb.Chain","(","[","tfb.Invert","(","tfb.CholeskyOuterProduct","(",")",")",",","tfb.MatrixInverse","(",")",",","tfb.CholeskyOuterProduct","(",")",",","]",")","``","`","However",",","the","actual","calculations","exploit","the","triangular","structure","of","the","matrices","."]
code: def _forward_log_det_jacobian(self, x):
      # CholeskyToInvCholesky.forward(X) is equivalent to
      # 1) M = CholeskyOuterProduct.forward(X)
      # 2) N = invert(M)
      # 3) Y = CholeskyOuterProduct.inverse(N)
      #
      # For step 1,
      #   |Jac(outerprod(X))| = 2^p prod_{j=0}^{p-1} X[j,j]^{p-j}.
      # For step 2,
      #   |Jac(inverse(M))| = |M|^{-(p+1)} (because M is symmetric)
      #                     = |X|^{-2(p+1)} = (prod_{j=0}^{p-1} X[j,j])^{-2(p+1)}
      #   (see http://web.mit.edu/18.325/www/handouts/handout2.pdf sect 3.0.2)
      # For step 3,
      #   |Jac(Cholesky(N))| = -|Jac(outerprod(Y)|
      #                      = 2^p prod_{j=0}^{p-1} Y[j,j]^{p-j}
      n = ps.cast(ps.shape(x)[-1], x.dtype)
      y = self._forward(x)
      return (
          self._cholesky.forward_log_det_jacobian(x, event_ndims=2)
          - (n + 1.0)
          * tf.reduce_sum(tf.math.log(tf.linalg.diag_part(x)), axis=-1)
      ) - (
          self._cholesky.forward_log_det_jacobian(y, event_ndims=2)
          - (n + 1.0)
          * tf.reduce_sum(tf.math.log(tf.linalg.diag_part(y)), axis=-1)
      )
  
file_path: probability/tensorflow_probability/python/bijectors/cholesky_to_inv_cholesky.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.bijectors.cholesky_outer_product import CholeskyOuterProduct
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 4 for calling the CholeskyToInvCholesky obj's underlying member method code with example usage: obj._forward_log_det_jacobian(x) and returns: unknown