Theano printing

Theano printing

To visualize the internal relation graph of theano variables.php

Installing

  1. conda install pydot graphvizpython

  2. add graphviz path D:\Anaconda\Library\bin\graphvizto system PATH[windows version]windows

or:app

  1. download installer from http://www.graphviz.org/Download_windows.php.
  2. conda install pydot graphviz
  3. add graphviz bin path C:\Program Files (x86)\Graphviz2.38\bin to system PATH[windows version]

Application

>>> import theano
>>> import theano.tensor as T
>>> x=T.matrix('x')
>>> y=T.matrix('y')
>>> z=x**2+y**3
>>> f=theano.function([x,y],z)
>>> theano.printing.pydotprint(z, outfile="symbolic_graph_unopt.png", var_with_name_simple=True)
The output file is available at symbolic_graph_unopt.png

>>> theano.printing.pydotprint(f, outfile="symbolic_graph_opt.png", var_with_name_simple=True)
The output file is available at symbolic_graph_opt.png