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

Bug in the Loss Function #12

Closed
saketguru opened this issue Sep 9, 2020 · 2 comments
Closed

Bug in the Loss Function #12

saketguru opened this issue Sep 9, 2020 · 2 comments

Comments

@saketguru
Copy link

The loss function currently implement is
-(oloss + nloss).mean()

It should be
(-oloss + nloss).mean()

You want to minimize the distance between "positive samples" and maximize the distance between "negative samples".

@theeluwin
Copy link
Owner

As you would've noticed, there's .neg() chain at the end of nvectors definition (https://github.com/theeluwin/pytorch-sgns/blob/master/model.py#L72).
But this does seem confusing. I'll fix it to be more verbose someday.

@saketguru
Copy link
Author

Yes. I noticed it. Thanks for the response.

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