-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add on_error
argument to linalg functions
#1078
Comments
Do we do anything on the Solve? |
On CholeskySolve you mean? Or just solve generally? Right now if |
Sorry I meant on the Cholesky that has this special behavior implemented. Do we do anything different on the gradient in the case of |
Yeah it gets replaced with a scalar 1 to allow some intermediate computation, then returns a matrix of |
So it returns |
This would also allow us to remove this switch logic in the multivariate logp: https://github.com/pymc-devs/pymc/blob/f5517186874107e72440ec9b55cd31ce77cc2a3d/pymc/distributions/multivariate.py#L181-L183 |
Description
Our implementation of
Cholesky
has a nice argumenton_error
that lets the user get backnan
from an bad input instead of halting the program. This would be a nice feature to have in other places where shoving in random matrices (pun intended) can be dangerous. I'm thinking specifically aboutpt.linalg.solve
, but I kept the issue name generic in case we think of others.The fix itself is trivial: add a try/except around the
perform
method of e.g. solve. The only wrinkle I foresee is what to do with the gradients.The text was updated successfully, but these errors were encountered: