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

Loss function is not squared in glove_cython? #22

Closed
ducovrossem opened this issue Dec 17, 2014 · 4 comments
Closed

Loss function is not squared in glove_cython? #22

ducovrossem opened this issue Dec 17, 2014 · 4 comments

Comments

@ducovrossem
Copy link

Not sure if I am missing something here but thought I'd ask for clarification - the loss function is not squared.

loss = entry_weight * (prediction - c_log(count))

Also this implementation does not generate seperate vectors for when word is used in context?

@maciejkula
Copy link
Owner

Bad variable name. I think this is the gradient of the loss function.

Yes, this implementation does not generate separate vectors for context words. This makes it more memory efficient, as I can use an upper triangular matrix for the co-occurrence matrix (and only one matrix of vectors).

@ducovrossem
Copy link
Author

Clear - thanks maciejkula.

@piskvorky
Copy link

FYI @maciejkula :
@dselivanov reports that this particular optimization (ignoring the context vectors) leads to a massive loss of accuracy:
http://rare-technologies.com/making-sense-of-word2vec/#comment-488

@maciejkula
Copy link
Owner

Interesting, I'll definitely have a look.

Incidentally, I think my more recent project (https://github.com/lyst/lightfm) should work really well on word embeddings (it uses a fancy learning-to-rank approach), I need to try it out.

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

3 participants