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

Fix wordrank max_iter_dump calculation. Fix #1216 #1217

Merged
merged 3 commits into from
Mar 20, 2017

Conversation

ajkl
Copy link
Contributor

@ajkl ajkl commented Mar 16, 2017

fix for #1216

@tmylk
Copy link
Contributor

tmylk commented Mar 17, 2017

Travis tests re-ran after smart_open update

@tmylk
Copy link
Contributor

tmylk commented Mar 17, 2017

Please add warning as in #1216 (comment)

@parulsethi
Copy link
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

@parulsethi
Copy link
Contributor

@tmylk LGTM

@tmylk tmylk changed the title fix for max_iter_dump calculation Fix wordrank max_iter_dump calculation. Fix #1216 Mar 20, 2017
@tmylk tmylk merged commit c5a053c into piskvorky:develop Mar 20, 2017
@tmylk
Copy link
Contributor

tmylk commented Mar 20, 2017

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)
Copy link
Owner

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.

@@ -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
Copy link
Owner

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.

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.

4 participants