Search code examples
theano

Is there any way to cache the theano compiling result?


I ask this question because the compiling process of theano is quite time consuming, and what making it worse is that each time I run the code, the function will be recompiled. So, is there any way to make theano cache the previous compiling result if there is no code change?


Solution

  • Theano already caches compilation results. The cache is stored in ~/.theano by default but the location and format of the contents can be adjusted via the config flags config.base_compiledir, config.compiledir_format, and config.compiledir.

    If you create a very large computation graph then the first run should be substantially slower than subsequent runs.