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

override _log_progress() in word2vec to track training loss #2081

Closed
wants to merge 3 commits into from

Conversation

usul83
Copy link

@usul83 usul83 commented Jun 4, 2018

I came across this suggestion from @villmow in this thread #1172 and thought I'd implement since @menshikh-iv thought it was a good idea and doesn't seem to have been done by anyone else.

First time I've contributed so appologies if not followed correct process etc.

@menshikh-iv
Copy link
Contributor

menshikh-iv commented Jul 30, 2018

Hi @usul83,

as I see, this is definition from https://github.com/RaRe-Technologies/gensim/blob/408a714e836484e914a7e3622b4f0f99a6d27ddd/gensim/models/base_any2vec.py#L1148 why this copy-paste needed (this method already inherited automatically)?

@usul83
Copy link
Author

usul83 commented Jul 30, 2018

It should be a little different from the any2vec version, it adds: self.get_latest_training_loss() / example_count

@menshikh-iv
Copy link
Contributor

@usul83 but in this case, compute_loss must be True, otherwise - this will not work, need to check this case.

@usul83
Copy link
Author

usul83 commented Jul 31, 2018

It won't work, but it will give a 0 rather than raise an error (since self.running_training_loss = 0 at line 556 whether compute_loss true or not). Maybe could add a check and a warning for that situation?

@menshikh-iv
Copy link
Contributor

menshikh-iv commented Aug 1, 2018

No warning needed, simply check, if compute_loss is False - use parent method, otherwise - your.
And also, please train an model with compute_loss=True and submit an log here (I want to see how it will look).

@menshikh-iv
Copy link
Contributor

this PR fully overlapped by #2135, for this reason, I close current.
@usul83 thanks for your work!

@menshikh-iv menshikh-iv closed this Aug 1, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants