Skip to content
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

Introduce KhatriRaoMap and FaceSplittingMap #191

Merged
merged 10 commits into from
Oct 12, 2022
Merged

Introduce KhatriRaoMap and FaceSplittingMap #191

merged 10 commits into from
Oct 12, 2022

Conversation

dkarrasch
Copy link
Member

@dkarrasch dkarrasch commented Sep 9, 2022

This is a major improvement for a narrow, but potentially interesting case: MichielStock/Kronecker.jl#91.

EDIT: I realized it makes sense to introduce a KhatriRaoMap type, which corresponds to "columnwise Kronecker products". For not too small matrices A and B with equal number of columns (say larger than 5), map-vector-application is faster than what you get for a materialized matrix-vector product, besides the added benefit that this is lazy! In other languages, explicit versions seem to be pretty standard, see:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.khatri_rao.html
https://www.rdocumentation.org/packages/Matrix/versions/1.4-1/topics/KhatriRao

Unfortunately, I couldn't find an improved way to implement the rowwise Kronecker product, or "face-splitting product", but since it's related to the adjoint/transpose of the Khatri-Rao product, it's included anyway.

@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Base: 99.58% // Head: 99.47% // Decreases project coverage by -0.11% ⚠️

Coverage data is based on head (e088b23) compared to base (bd10c6c).
Patch coverage: 96.96% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #191      +/-   ##
==========================================
- Coverage   99.58%   99.47%   -0.12%     
==========================================
  Files          18       19       +1     
  Lines        1460     1526      +66     
==========================================
+ Hits         1454     1518      +64     
- Misses          6        8       +2     
Impacted Files Coverage Δ
src/LinearMaps.jl 100.00% <ø> (ø)
src/khatrirao.jl 96.72% <96.72%> (ø)
src/kronecker.jl 98.84% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dkarrasch dkarrasch changed the title Optimize vector ⊗ vector case Introduce KhatriRaoMap and FaceSplittingMap Oct 5, 2022
@dkarrasch
Copy link
Member Author

@PythonNut Do you wanna take a look and see if it's useful for you?

@dkarrasch dkarrasch merged commit 50f5bf9 into master Oct 12, 2022
@dkarrasch dkarrasch deleted the dk/veckron branch October 12, 2022 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant