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

Optimize Poincare model training #2589

Merged
merged 3 commits into from Sep 7, 2019
Merged

Optimize Poincare model training #2589

merged 3 commits into from Sep 7, 2019

Conversation

koiizukag
Copy link
Contributor

Reduce computational complexity O(N^2) => O(N).
This part is the bottleneck of the overall training phase.

Copy link
Owner

@piskvorky piskvorky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch @koiizukag .

How did you find this? Any more examples of weak programming we could fix, while at it?

gensim/models/poincare.py Outdated Show resolved Hide resolved
@koiizukag
Copy link
Contributor Author

Thanks @piskvorky .

I found this insufficient implementation via python profiler.

If we use multiprocessing in independent for loop, we can make this model faster.
ex: https://github.com/RaRe-Technologies/gensim/blob/develop/gensim/models/poincare.py#L545
Also, it is better to use Cython like other gensim models.

@mpenkov
Copy link
Collaborator

mpenkov commented Sep 7, 2019

Thank you for your contribution @koiizukag.

@piskvorky This looks good to merge to me. Is there anything left on this PR that you want to do before we merge this?

@mpenkov mpenkov self-assigned this Sep 7, 2019
@piskvorky
Copy link
Owner

LGTM. My only question was around fixing other similar issues in Poincare, since we (@koiizukag ) are at it. But nothing blocking.

@piskvorky piskvorky changed the title Fix poincare models's list operation Optimize Poincare model Sep 7, 2019
@piskvorky piskvorky changed the title Optimize Poincare model Optimize Poincare model training Sep 7, 2019
@mpenkov mpenkov merged commit a47eed8 into piskvorky:develop Sep 7, 2019
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

3 participants