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

Best way to interpret final matmul? #26

Open
jeffreymei opened this issue Aug 16, 2022 · 1 comment
Open

Best way to interpret final matmul? #26

jeffreymei opened this issue Aug 16, 2022 · 1 comment

Comments

@jeffreymei
Copy link

In this line, what is the best way to think about this matmul? I see that it is calculating dot products for the final_feat and each emb in item_embs. If item_embs were normalized, then I could see this being essentially evaluating the cosine similarity (within a scaling factor) of the item_embs with respect to final_feat, but because the item_embs can vary in magnitude by ~30% or so it is not quite the same. Can you give any insight into this?

Thanks!

@pmixer
Copy link
Owner

pmixer commented Aug 17, 2022

Hi @jeffreymei , thx for the question, as I just reimplemented the SASRec in pytorch, some details may need to be double checked by original paper authors https://github.com/kang205/SASRec/issues.

From my view, the final matmul is kind of like evaluating the cosine similarity, as inherited from classical matrix factorization method for recommendation https://developers.google.com/machine-learning/recommendation/collaborative/matrix, w/o theoretical guarantee, people just want to have something to compare item distance, so just picked an older component to try.

It may not be the best choice, and elaborating into details may help finding something better for replacement.

Thus, instead of trying to interpret the final matmul accurately, personally, I suggest try something new beyong current approach.

Regards,
Zan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants