yoyololicon / pytorch-NMF

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

Constantly getting arrays full of NaN when using NMF #5

Open chadD123321 opened 3 years ago

chadD123321 commented 3 years ago

I am attempting to utilize nmf on video data. it is 3 dimensional but I have also collapsed it to 2 dimensions in hopes that would work(with appropriate NMF3D and NMF2D utilization). regardless of input shape, I try to use the fit_transform function and my returned V matrix is comprised of only NaN's . I imagine I am incorrectly training or fitting the data but any insight would be appreciated.

yoyololicon commented 3 years ago

Have you tried adjusting the beta value? Which beta divergence are you using? You can try beta=2 which is more numerically stable in my experience.

yoyololicon commented 3 years ago

@chadD123321 I have updated this package recently, could you help try again on the newest version? Docs and installation: https://pytorch-nmf.readthedocs.io/en/latest/ Please install directly from github (the pypi version has some bugs.)