You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A very useful pattern has emerged to broadcast a vector across a matrix.
Convert the vector into a diagonal matrix
Perform matrix multiplication using an any_XXX semiring
If the diagonal matrix is on the left, it broadcasts the vector as if it were a column vector.
If the diagonal matrix is on the right, it broadcasts the vector as if it were a row vector.
While this works, it has downsides.
While the storage of a diagonal matrix isn't large, it does require creating another object besides the original vector
The monoid part of the semiring is pointless, but must be specified
I think it might make sense to create a graphblas.diag_matmul operation which takes a vector and matrix and a binary operator and does the broadcasting. The order of the vector determines how it is broadcast.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
A very useful pattern has emerged to broadcast a vector across a matrix.
any_XXX
semiringIf the diagonal matrix is on the left, it broadcasts the vector as if it were a column vector.
If the diagonal matrix is on the right, it broadcasts the vector as if it were a row vector.
While this works, it has downsides.
I think it might make sense to create a
graphblas.diag_matmul
operation which takes a vector and matrix and a binary operator and does the broadcasting. The order of the vector determines how it is broadcast.Beta Was this translation helpful? Give feedback.
All reactions