Can Tensorflow take gradient on matrix 2-norm?

295 Views Asked by At

Normally the matrix norm we took in Tensorflow is Frobenius norm which is easy to compute and easy to understand, e.g., a Bayesian view. But in many cases, it is the largest singular value matters. It is possible to optimize that in Tensorflow? It depends on whether tensorflow can take gradient with respect to matrix 2-norm.

1

There are 1 best solutions below

3
On

Actually, the spectral norm is equal the largest singular value. To get to this value you can use TensorFlow's linalg.svd.