Bug in the Loss Function
Closed this issue · 2 comments
saketguru commented
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 commented
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 commented
Yes. I noticed it. Thanks for the response.