Closed saketguru closed 4 years ago
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.
Yes. I noticed it. Thanks for the response.
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".