-
-
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
Optimise LdaModel.show_topics performance to only call get_lambda once #1006
Comments
I would like to work on the issue. How do I start? |
Let's finish your other PRs first @souravsingh :) |
@tmylk I tried a fair amount to try and fix this but the only solutions which I could think of are not very pretty. We could maybe have an option to pass the The other option is to completely avoid calling Both the methods I tried work and pass tests without having to call Any other suggestions? |
The optimised show_topics should not call the show_topic. That is a good solution |
Thanks a lot ! I'll check this |
This function calls show_topic for each topic, which calls get_topic_terms which calls self.state.get_lambda().
self.state.get_lambda() call is very expensive, it is not dependent on a topic and can be called once for all.
On my setup (500 topics, 100k words, learned with 500k documents), calling show_topics takes 30sec, with 28sec inside the 500 get_lambda() calls
The text was updated successfully, but these errors were encountered: