I would like to get a gradient tf.choleskyregarding its input. Currently tf.choleskyhas no registered gradient:
LookupError: No gradient defined for operation 'Cholesky' (op type: Cholesky)
The code used to generate this error is:
import tensorflow as tf
A = tf.diag(tf.ones([3]))
chol = tf.cholesky(A)
cholgrad = tf.gradients(chol, A)
While I can compute the gradient and register it myself, the only existing means by which I saw the calculated Cholesky gradient included using for loops and needs an input matrix form. However, to my knowledge, symbolic loops are not currently available for TensorFlow.
One of the possible ways to bypass the shape of the input matrix Ais likely to use:
[int(elem) for elem in list(A.get_shape())]
, A - TensorFlow TensorShape([Dimension(None)]).
- , tf.cholesky, .