Printing/Drawing Theano graphs
pprint()更紧凑,更像数学
o theano.printing.pprint(prediction)
’gt((TensorConstant{1} / (TensorConstant{1} + exp(
TensorConstant{0.5})’
debugprint()更冗长。
o theano.printing.debugprint(prediction)
预编译图:
后编译图:
pydotprint(),用于创建函数的图像。
o预编译图:
theano.printing.pydotprint(prediction, outfile
o后编译图:
theano.printing.pydotprint(predict, outfile="p
o优化的训练图:
theano.printing.pydotprint(train, outfile="pic
Interactive Graph Visualization
o新的d3viz模块
pip install pydot-ng
predict_profiled = th.function([x], y, profile=True)
x_val = rng.normal(0, 1, (ninputs, nfeatures))
y_val = predict_profiled(x_val)
d3v.d3viz(predict_profiled, ‘examples/mlp2.html’)
它不是创建静态图像,而是生成一个HTML文件
预编译图:
theano.printing.pydotprint(predict, outfile="p
theano.printing.pydotprint(train, outfile="pic
后编译图:
theano.printing.pydotprint(prediction, outfile
它不是创建静态图像,而是生成一个HTML文件
参考文献
- http://deeplearning.net/software/theano/library/d3viz/index.html
- theano 中文手册