-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Generalize linalg.det
beyond 2D arrays
#1065
Comments
Happy to take this up, but I want to sanity check. Current implementation in aesara is using np: https://github.com/aesara-devs/aesara/blob/main/aesara/tensor/nlinalg.py#L214
Expectation would be to continue to defer to numpy for implementation, thus assuming last two dimensions have same length and broadcasting the determinant, but remove the dim == 2 assert. Fine, but does anyone remember why the assert exists for aesera cases specifically? |
That would be great, but I believe this is one of many other pending
Which assert? If you're referring to the one in |
I this case it seems like nothing new is needed other than removing the assert and checking if infer_shape and grad work, because numpy.linalg.det works with batched inputs out of the box: https://numpy.org/doc/stable/reference/generated/numpy.linalg.det.html We should not need #695, because the limitation here was artificial to begin with. |
That's largely what #695 provides, as well as a single interface for transpilation, etc. |
We absolutely do, if only to reduce the amount of redundant code, redundant testing time, time spent reviewing, and so on. |
I don't get why. If the wrapped Op is not constrained to 2D inputs, why act like it is and use extra machinery to extend beyond it? |
As I said above, a Furthermore, an implementation in this scenario would look something like the following: class Det(Op):
# Perhaps some `nfunc_spec`-like information here...
def perform(self, ...):
# The current `Det.perform`...
# Potentially nothing else...
det = Blockwise(Det, signature=((("m", "n"),), ((),))) I don't see how it could get much easier than that. Also, we'll probably have something more general like Remember, we're basically talking about an extension to Also, consider how difficult it would be for external developers to implement custom
Because there is no "extra machinery" if we do this the way I'm describing, but there is if we do it the way you seem to be advocating (i.e. creating redundant |
could someone assign this issue to me? |
@purna135, take a look at #1065 (comment). From an administrative standpoint, this project needs to focus its efforts on #695, since that would close—or directly assist with closing—this issue, #488, #791, and #612. It would also affect the formulation of solutions to #1089, #1094, #933, #617, #770, #547, #712, and numerous rewrite-related simplifications and issues. |
Hi @brandonwillard Working on #695 is currently out-of-scope. I indeed see long-term benefits if efforts are redirected towards #695 If you like, we can redefine the scope of the project to first work on #695 and then work on multivariate distributions at PyMC side. |
On a related note, see the note in NumPy's documentation for |
The text was updated successfully, but these errors were encountered: