Hi all, Im new here.
I know this fact about gradient on matrix inverse.
$$
\gradient_\theta K(\theta) = K^-1 \times \gradient_\theta K \times K^-1
$$
I wonder how tf handles matrix inverses. Does tf implements inverses as the formula above or does it simple ignore inverses when computing gradient?
Hi @Anarion_Zuo
Welcome to the TensorFlow Forum!
Please provide some more details on the issue. TensorFlow does have few APIs to inverse the matrix as tf.linalg.inv and tf.GradientTape for the Automatic Differentiation to compute gradients for various operations, including matrix inversion.
Please refer the above mentioned links for more details on TensorFlow Gradient computation. Thank you.
Hi Renu,
I tried tf.linalg.inv() in my tf script but cannot use gradient tape to calculate the gradient.
To be more precise, I just changed tf.linalg.inv to another operation then the gradient can be calculated otherwise the gradient back-prop would be just nan.
I am using TensorFlow 2.16.1.
Hope u guys can help me.
Yours Sincerely,
Jade.