yoyololicon / pytorch-NMF

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

Definition of the NMF matrixes? #28

Closed tppcc closed 4 months ago

tppcc commented 8 months ago

Hello! Thanks for your work on this package, however I have a few question:

  1. In your script the H(N,R) is defined to be the mapping matrix that projects the source matrix to it's latent representation, and W(C,R) is the latent representation of the source matrix? Because in the paper from our side the W and H is the exact opposite meaning so I just want to make sure.
  2. and if the H and W is defined as they are above, then shouldn't the W matrix in NMF3D becomes (C,R, x, y, z) instead? according to the documentation W takes (C,R, kernel size...) as dimension

Thanks so much!

yoyololicon commented 8 months ago
  1. In your script the H(N,R) is defined to be the mapping matrix that projects the source matrix to it's latent representation, and W(C,R) is the latent representation of the source matrix? Because in the paper from our side the W and H is the exact opposite meaning so I just want to make sure.

I guess it depends on which convention is more popular in your field. I have a music information retrieval background, and we usually treat W as the template matrix, which means latent representation, I guess. It shouldn't be a big issue because you can swap H and W before and after fitting the data.

  1. and if the H and W is defined as they are above, then shouldn't the W matrix in NMF3D becomes (C,R, x, y, z) instead? according to the documentation W takes (C,R, kernel size...) as dimension

It's simply for the sake of aligning with the PyTorch convention of Conv*d operators. https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html