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
The Khatri-Rao product is a matrix product that is closely related to the Kronecker product. Although the definition of Khatri-Rao product applies to partitioned matrices, it is common to use the trivial partition (where every element is in its own partition). In this case, the Khatri-Rao product becomes the column-wise Kronecker product. One (probably pretty inefficient) way to implement the Khatri-Rao product in this case would be:
khatri_rao(A, B) = mapreduce(kron, hcat, eachcol(A), eachcol(B))
This means that a lazy Khatri-Rao product could be created using existing tools, but this would require a lot of reshaping and a lot of lazy hcats which are slow, and of course the real benefits come when we encode algebraic optimizations using multiple dispatch. There is also an analogous row-wise product called the transposed Khatri-Rao product (or the "face-splitting" product).
paper with some detailed discussion of the Kronecker and Khatri-Rao products and efficient (eager) implementations in Julia of Khatri-Rao matrix and vector products.
The Khatri-Rao product is a matrix product that is closely related to the Kronecker product. Although the definition of Khatri-Rao product applies to partitioned matrices, it is common to use the trivial partition (where every element is in its own partition). In this case, the Khatri-Rao product becomes the column-wise Kronecker product. One (probably pretty inefficient) way to implement the Khatri-Rao product in this case would be:
This means that a lazy Khatri-Rao product could be created using existing tools, but this would require a lot of reshaping and a lot of lazy
hcat
s which are slow, and of course the real benefits come when we encode algebraic optimizations using multiple dispatch. There is also an analogous row-wise product called the transposed Khatri-Rao product (or the "face-splitting" product).References:
The text was updated successfully, but these errors were encountered: