-
Notifications
You must be signed in to change notification settings - Fork 36
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
How can I make it calculate more faster? #66
Comments
That depends a lot on how you actually use it. The main bottleneck is reading the index. Using a GPU instead of a CPU does most probably not help since there are no expensive matrix operations 😉 Do you have a large set of topics that you would like to evaluate at once? |
yes, I embedded it into my training code, to evaluate C_V per 10 epoch, and it apparently slow down my training speed. |
by the way, I set my topic as 20 and topic words as 15, I guess calculating all topics (20) one time instead of calculate one by one would boost the speed since it just needs to read the index file one time, it can be reach? |
|
I use the palmetto-py API So, I suggest giving a new API that can calculate the whole K topic in a single call, as it just needs to load the index file one time. |
Thanks for clarifying your setup. Your assumption is not correct. You start the web service only once at the very beginning of your program (at least I assume that). The calls to the web service will simply always cause a search on the index. It doesn't matter how many topics you could send at once. So although I think the extension of the API might be a good idea, it won't change the runtime. The only change that I can think of at the moment with respect to runtime might be the implementation of a cache. The cache could be implemented as a decorator of the WindowSupportingLuceneCorpusAdapter class and cache the result of the I may have two suggestions that could improve the runtime (I guess you already thought of them):
|
Thanks for your careful reply! I get your advice. But maybe it needs to change the I have a new problem is that the python interface API often gives me |
Yes, I can understand that. Seems like nobody has a lot of time these days 😉 You can increase the time the python client waits by setting the timeout attribute. As an alternative, you could also run Palmetto from command line and read the result from command line. This would ensure that your program waits and that you get rid of the HTTP-based communication. However, I am not sure how much effort it is to implement that within Python. So maybe it is just another weird idea 😄 |
The calculate is a little bit slow, is there some method to speed it up? Can I use GPU instead of CPU?
The text was updated successfully, but these errors were encountered: