-
Notifications
You must be signed in to change notification settings - Fork 15
Correctness Bug: wrong semiring used in functional-style triple product #498
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
Comments
Hey @alugowski, thanks for raising this usability issue! I hope you raise more suggestions :) I'm sorry for my delay--I was traveling and largely AFK last week. This issue has come up before, and you can see our previous discussion in #132. I'm open to adding this functionality, but I want us to think hard about it. Please be patient as we seek consensus (including yours!) and explore options and implementations. I think the behavior you expect for matrix multiply is very reasonable, and is a pattern I expect to occur semi-regularly (you're not the first to encounter this). Our current behavior may be surprising and counterintuitive--especially for users coming from I have begun an implemention in #501. |
No worries! I see a lot of potential syntax options in that discussion. I don't have a strong opinion about those options, and what you have now works for me. The thing that confused me is that the brackets in To me |
Yeah, it's a reasonable expectation, and the implementation in #501 actually isn't as bad as I was expecting. I wonder about the other infix operations, such as: gb.binary.min(A | B | C) # ewise_add
gb.binary.max(A & B & C) # ewise_mult
gb.binary.plus(A | B | C, left_default=0, right_default=0) # ewise_union The above are probably okay, b/c the infix operators are the same and there are no surprises from operator precedence. I would probably have the below raise, b/c they're getting kinda complicated for sugar, and operator precedence ( gb.binary.max(A | B & C) # mix of ewise_add and ewise_mult
gb.binary.plus(A | B & C, left_default=0, right_default=0) # mix with ewise_union??? Probably raise
You mean like |
I agree to raise for
Ah, so it does. I copied the pattern from the docs and didn't realize there are more options :) |
Thanks again for sharing your thoughts @alugowski. I'm pushing ahead in #501 for chaining like expressions together, such as |
Closed via #501; releasing soon. |
The functional style multiply, i.e.
gb.semiring.plus_plus(A @ B)
, appears to not respect the semiring choice when doing a triple productA @ B @ C
.Let:
A triple product using the
plus_first
semiring returns a 1x1 matrix with a count of nonzeros in A, which is 3. Indeed that is what the method style triple product returns:However the functional-style triple product,
It appears that the
plus_first
semiring is only used for one of the multiplications, andplus_times
for the other.Application is to implement a triple product that creates a low resolution spy plot, like this:
See MatSpy.
The text was updated successfully, but these errors were encountered: