Skip to content

Fix wordrank max_iter_dump calculation. Fix #1216#1217

Merged
tmylk merged 3 commits into
piskvorky:developfrom
ajkl:patch-3
Mar 20, 2017
Merged

Fix wordrank max_iter_dump calculation. Fix #1216#1217
tmylk merged 3 commits into
piskvorky:developfrom
ajkl:patch-3

Conversation

@ajkl
Copy link
Copy Markdown
Contributor

@ajkl ajkl commented Mar 16, 2017

fix for #1216

@tmylk
Copy link
Copy Markdown
Contributor

tmylk commented Mar 17, 2017

Travis tests re-ran after smart_open update

@tmylk
Copy link
Copy Markdown
Contributor

tmylk commented Mar 17, 2017

Please add warning as in #1216 (comment)

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


# 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
Copy Markdown
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