-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matrix_power issues #117
Comments
The exactly equal thing is a known problem which I plan to fix soon. See #44. The matrix_power generating a non-invertible matrix for n=-1 is a bug. It's supposed to avoid doing that, so I'll need to take a look as to why that is happening. |
I'm not able to reproduce the matrix_power n=-1 issue. The code should only be generating invertible matrices when n < 0. Can you run the test with |
I should add that the NumPy implementation raises an exception for |
I'll also just add to make sure you are using the latest versions of both the array_api_tests and hypothesis. |
I can have a look at this later, just to clarify this example
It's failing because the 4th zero is positive in |
The first two failures are coming from testing exact equality in stacking (I think, @mattbarrett98 didn't show the full stack trace), which is something we do want to test differently. A difference between positive and negative zero can be something that is affected by the numerical details of a specific algorithm. I don't know what the actual inputs were here (again, @mattbarrett98 it would be helpful to provide that detail), but there aren't any cases in linalg where such things are specified. |
Thanks I think this should resolve the first 2 issues! As for the +-0, in what situations do we care about them being different and why? For the invertible matrix issue, yes we test against numpy also and this has never had this issue. I wonder if this is because in numpy it throws an exception when trying to invert the given matrix. However jax.numpy actually gives you a result when asking it to invert that same non-invertible matrix? |
From the top of my head: manipulation functions because those shouldn't change the actual elements of an array, and some elementwise functions because of special cases. |
This is a stack trace for the non-invertible matrix error:
This is the commit where the test failed. At the time, we were testing against this commit. Perhaps the commits since 28th March have fixed this? |
My guess is it has to do with the fact that it's Jax, which works differently from the other array libraries due to it being graph based. I don't think we've used Jax much in the test suite so far, so it's not surprising if there are some issues. Either way, I'll take a look to see if I can reproduce the issue. |
I was able to reproduce the matrix_power issue. I'm still not clear what is going on, but it appears to be fixed by #101. |
…n the Array API test. Waiting for the fix on data-apis/array-api-tests#117.
I believe this should be fixed. Let me know if you still see these failures. |
Hi, I'm working with Ivy where we are wrapping various ML frameworks and trying to align them with the Array API standard https://github.com/unifyai/ivy. The first problem I'm having is slight numerical issues. For example, when using TensorFlow I have gotten the error:
For PyTorch, I have gotten the error:
These types of failures don't appear each time I run the tests, only appearing every few runs. I wonder if something similar to NumPy.allclose would be better for value checking, as matrix_power seems like a function susceptible to these very small errors.
Also, when testing against JAX I get a failure caused by the following falsifying example:
which is strange given that here
x
isn't invertible andn
is negative, which it says intest_matrix_power
shouldn't occur.The text was updated successfully, but these errors were encountered: