jax.numpy.linalg.svd & numpy.linalg.svd => different conventions? #10519
Unanswered
jecampagne
asked this question in
Q&A
Replies: 2 comments 8 replies
-
Hi - in general, there is no preferred sign for eigenvectors of an svd. Even for numpy itself, different systems will return eigenvectors of different signs for the same input (see e.g. numpy/numpy#21313). As such, I would say what you're seeing is expected behavior. |
Beta Was this translation helpful? Give feedback.
6 replies
-
I think you should use the sign of the sequential principal minor determinant to choose the sign of eigenvectors, in order to have a portable implementation. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I experience a rather subtle/nasty difference between jax.numpy.linalg.svd & numpy.linalg.svd.
(nb. after first edition, I run also jax.scipy.linalg.svd & jax.lax.linalg.svd they both agree to jax.numpy.linalg.svd, so they are different than numpy.linalg.svd)
(nb new add: numpy.linalg.svd agrees with Mathematica convention)
I'm running
Here is a snippet that reproduces the problem:
which leads to
As you see, the "a" and "c" of the SVD have sign differences between Numpy and Jax.Numpy...
Is-it foreseen? Does it is well documented/advertised (I do not find mention of this in the doc) ?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions