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

Support Sparse Matrix as Target Matrix #16

Merged
merged 20 commits into from
Mar 17, 2021
Merged

Support Sparse Matrix as Target Matrix #16

merged 20 commits into from
Mar 17, 2021

Conversation

yoyolicoris
Copy link
Owner

This PR add the ability to call fit and sparse_fit when target is a 2-dimensional torch.sparse_coo_tensor.
This is only valid on NMF, other class of NMF will throw not implemented error.

@yoyolicoris yoyolicoris added enhancement New feature or request doing labels Mar 15, 2021
@yoyolicoris yoyolicoris self-assigned this Mar 15, 2021
@yoyolicoris yoyolicoris added this to the v0.3.4 milestone Mar 15, 2021
@codecov-io
Copy link

codecov-io commented Mar 15, 2021

Codecov Report

Merging #16 (dec2d34) into master (ea4ebcb) will decrease coverage by 5.99%.
The diff coverage is 74.01%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   94.63%   88.63%   -6.00%     
==========================================
  Files           7        7              
  Lines         671      792     +121     
==========================================
+ Hits          635      702      +67     
- Misses         36       90      +54     
Flag Coverage Δ
unittests 88.63% <74.01%> (-6.00%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
torchnmf/nmf.py 84.34% <71.95%> (-11.37%) ⬇️
torchnmf/metrics.py 100.00% <100.00%> (ø)
torchnmf/trainer.py 93.75% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea4ebcb...dec2d34. Read the comment docs.

@yoyolicoris
Copy link
Owner Author

Seems that training would become very unstable when using sparse_fit with sparse target and beta < 0,
Maybe add extra docstring on sparse_fit to mention that beta = 2 is prefered (the original paper only use euclidean distance), other beta values is not gaurantee to work.

@yoyolicoris yoyolicoris merged commit 8fd3454 into master Mar 17, 2021
@yoyolicoris yoyolicoris removed the doing label Mar 17, 2021
@yoyolicoris yoyolicoris deleted the sp-mu-update branch March 17, 2021 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants