February 2019
Intermediate to advanced
672 pages
16h 50m
English
Given the importance of measuring and analyzing performance, Theano provides powerful and informative profiling tools. To generate profiling data, the only modification needed is the addition of the profile=True option to th.function:
calculate_pi = th.function([x, y], pi_est, profile=True)
The profiler will collect data as the function is being run (for example, through timeit or direct invocation). The profiling summary can be printed to output by issuing the summary command, as follows:
calculate_pi.profile.summary()
To generate profiling data, we can rerun our script after adding the profile=True option (for this experiment, we will set the OMP_NUM_THREADS environmental variable to 1). Also, we will revert our script ...
Read now
Unlock full access