Theano printing
To visualize the internal relation graph of theano variables.
Installing
-
conda install pydot graphviz -
add graphviz path
D:AnacondaLibraryingraphvizto systemPATH[windows version]
or:
- download installer from
http://www.graphviz.org/Download_windows.php. conda install pydot graphviz- add graphviz bin path
C:Program Files (x86)Graphviz2.38into 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
