Fix wordrank max_iter_dump calculation. Fix #1216#1217
Merged
Conversation
Contributor
|
Travis tests re-ran after smart_open update |
Contributor
|
Please add warning as in #1216 (comment) |
Contributor
|
thanks for the improvement, please make default iter=90 (now that +1 iter is taken care of inside the function), so that user don't get a warning at default parameters |
Contributor
|
@tmylk LGTM |
Contributor
|
Thanks for the fix. Glad wordrank is being useful. |
piskvorky
reviewed
Apr 9, 2017
| if iter % dump_period == 0: | ||
| iter += 1 | ||
| else: | ||
| logger.warning('Resultant embedding would be from %d iteration', iter - iter % dump_period) |
Owner
There was a problem hiding this comment.
Seeing this warning tells the user nothing -- can you rephrase/add context/suggestions what to do about it?
Also, iteration => iterations and dump_period as an argument to warning(), rather than formatted string.
|
|
||
| # use embeddings from max. iteration's dump | ||
| max_iter_dump = (iter - 1) - (iter - 1) % dump_period | ||
| max_iter_dump = iter - iter % dump_period |
Owner
There was a problem hiding this comment.
Use explicit brackets, don't rely on operator precedence.
tmylk
pushed a commit
that referenced
this pull request
May 10, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix for #1216