yoyololicon / pytorch-NMF

A pytorch package for non-negative matrix factorization.
https://pytorch-nmf.readthedocs.io/
MIT License
223 stars 24 forks source link

Handling NAN values in NMF #29

Open PolarBean opened 4 months ago

PolarBean commented 4 months ago

There is this fantastic pull request in sklearn which does not apply the loss value to parts of the matrix which have nan values. https://github.com/scikit-learn/scikit-learn/pull/8474 Is this possible in pytorch-NMF at present?

yoyololicon commented 4 months ago

Hi @PolarBean , thanks for asking. I have a very brief look at the PR you mentioned. It looks like it's a weighted version of NMF, and can be handled with masked tensors. https://pytorch.org/tutorials/prototype/maskedtensor_overview I'll have a proper look when I have the time, but it sounds doable.

PolarBean commented 4 months ago

very interesting, thank you!