Matrixexponential: "expm(0) == nan"
See original GitHub issueI have noticed that feeding an array of only zeros into jax.scipy.linalg.expm
results in a purely np.nan
array.
It should be the unit matrix, e.g. expm(zeros) == np.eye(*zeros.shape)
Minimal reproducer:
import jax.numpy as np
from jax.version import __version__
from jax.scipy.linalg import expm
print(f'jax version: {__version__}')
# jax version: 0.1.58
zero = np.zeros([2, 2], dtype=np.float32)
exp_zero = expm(zero)
print(f'exp(zero) == \n{exp_zero}')
# exp(zero) ==
# [[nan nan]
# [nan nan]]
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Matrix exponential error in scipy.linalg with python
I wanted make rotation of 2pi around y axis (m_13) but linalg.expm cannot calculate for angle around pi or 2pi only small amounts...
Read more >expm: Matrix Exponential, Log, 'etc' - R Project
This function computes the exponential of a square matrix A, defined as the sum from r = 0 to infinity of Ar/r!. Several...
Read more >How to calculate expm of a badly scaled matrix? - MathWorks
I'm using expm for a matrix with big and small coefficients and I get NaN in the result. Is there a method to...
Read more >Matrix exponential properties - YouTube
Showing that exp (A+B) doesn't equal exp (A) exp (B), but showing that it's the case when AB = BACheck out my Eigenvalues...
Read more >Differential Equations | The Matrix Exponential e^{tA}. - YouTube
We outline a strategy for finding the matrix exponential e^{tA}, including an example when A is 2x2 and not diagonalizable.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Should be fixed now by #2192