-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix wordrank max_iter_dump calculation. Fix #1216 #1217
Conversation
Travis tests re-ran after smart_open update |
Please add warning as in #1216 (comment) |
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 |
@tmylk LGTM |
Thanks for the fix. Glad wordrank is being useful. |
if iter % dump_period == 0: | ||
iter += 1 | ||
else: | ||
logger.warning('Resultant embedding would be from %d iteration', iter - iter % dump_period) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
gensim/models/wrappers/wordrank.py
Outdated
@@ -141,7 +146,7 @@ def train(cls, wr_path, corpus_file, out_path, size=100, window=15, symmetric=1, | |||
output = utils.check_output(args=cmd) | |||
|
|||
# use embeddings from max. iteration's dump | |||
max_iter_dump = (iter - 1) - (iter - 1) % dump_period | |||
max_iter_dump = iter - iter % dump_period |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use explicit brackets, don't rely on operator precedence.
fix for #1216