IndicoDataSolutions / Passage

A little library for text analysis with RNNs.
MIT License
530 stars 134 forks source link

Model instantiation is very slow #37

Open adithyarao opened 9 years ago

adithyarao commented 9 years ago

While trying out the example provided in the Readme, I noticed that this line executes very slowly:

model = RNN(layers=layers, cost='BinaryCrossEntropy')

Profiling shows that this line takes around 20 seconds to execute on both CPU as well as GPU. I am observing similar performance for the load function in utils.py as well. Am I missing something here? If not, can this be sped up somehow? ( Such performance poses a serious obstacle in loading trained models in real time applications. )

youralien commented 9 years ago

@adithyarao, I have a hunch that the slow execution when building and loading models has more to do with Theano than Passage itself. Theano takes time to compile graphs of computation, both on CPU and GPU. For real world applications, the best bet is to keep a server continuously running with the Theano graph already compiled.