yoyololicon / pytorch-NMF

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

Loss Value Too Big #23

Closed guoyang9 closed 2 years ago

guoyang9 commented 2 years ago

Hi, I tried with a large sparse matrix, say 100, 000 \times 100, 000. When I trained with the vanilla NMF model, the losses are too big - 5e3.

Do you have any idea of what issues it could be?

Thank you for the contribution.

yoyololicon commented 2 years ago

@guoyang9 I didn't normalize the loss value (e.g. divide by the size of the matrix) so it can be very large depending on the size of your input. If your loss value can gradually become smaller with more iterations then I think it's fine.

guoyang9 commented 2 years ago

Thank you for your prompt response. I suspect the quality being not satisfactory is because that NMF cannot handle such sparse matrix (99.99% sparsity).