blocks icon indicating copy to clipboard operation
blocks copied to clipboard

Delay compilation for as long as possible

Open cooijmanstim opened this issue 10 years ago • 3 comments

I notice that DataStreamMonitor compiles its variables (by instantiating DatasetEvaluator) right in its constructor. It would be nice to delay this until before_training to have a tighter debugging cycle, as I often get crashes due to typos etc. between setting up monitoring and the main loop and actually training.

cooijmanstim avatar Nov 06 '15 20:11 cooijmanstim

+1

dwf avatar Nov 06 '15 20:11 dwf

On the other hand, @lamblin said to me that it's better to compile your functio as early possible with current version of Theano because in forks a new process for compilation and allocates as much memory as a parent process.

Even if this Theano bug fixed, I don't like that different functions are compiled in different time because it's tricky to measure total compilation time. Should we add a new callback for compilation? It should solve all the problems.

dmitriy-serdyuk avatar Nov 06 '15 20:11 dmitriy-serdyuk

We could do all compilation in before_training, that's where the algorithm compilation is currently done.

I like the proposal, by the way.

rizar avatar Nov 26 '15 15:11 rizar