Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
fa5f3ed9
提交
fa5f3ed9
authored
4月 26, 2015
作者:
Christof Angermueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace pydotprint_variables by pydotprint and minor changes
上级
81e6bba0
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
17 行增加
和
3 行删除
+17
-3
advanced_theano.txt
doc/cifarSC2011/advanced_theano.txt
+12
-0
logreg_pydotprint_predic.png
doc/cifarSC2011/pics/logreg_pydotprint_predic.png
+0
-0
f_optimized.png
doc/hpcs2011_tutorial/pics/f_optimized.png
+0
-0
f_unoptimized.png
doc/hpcs2011_tutorial/pics/f_unoptimized.png
+0
-0
simple_example.py
doc/hpcs2011_tutorial/simple_example.py
+1
-1
symbolic_graph_unopt.png
doc/tutorial/pics/symbolic_graph_unopt.png
+0
-0
symbolic_graphs.txt
doc/tutorial/symbolic_graphs.txt
+4
-2
没有找到文件。
doc/cifarSC2011/advanced_theano.txt
浏览文件 @
fa5f3ed9
...
...
@@ -304,6 +304,8 @@ Consider the following logistic regression model:
>>> train = theano.function(inputs=[x,y], outputs=[prediction, xent], updates=[[w, w-0.01*gw], [b, b-0.01*gb]], name = "train")
>>> predict = theano.function(inputs=[x], outputs=prediction, name = "predict")
We will now make use of Theano's printing features to compare the unoptimized
graph (``prediction``) to the optimized graph (``predict``).
- Pretty Printing
...
...
@@ -314,6 +316,8 @@ TensorConstant{0.5})'
- Debug Print
The graph before optimization:
>>> theano.printing.debugprint(prediction) # doctest: +NORMALIZE_WHITESPACE
Elemwise{gt,no_inplace} [@A] ''
|Elemwise{true_div,no_inplace} [@B] ''
...
...
@@ -333,6 +337,8 @@ TensorConstant{0.5})'
|DimShuffle{x} [@O] ''
|TensorConstant{0.5} [@P]
The graph after optimization:
>>> theano.printing.debugprint(predict) # doctest: +NORMALIZE_WHITESPACE
Elemwise{Composite{GT(scalar_sigmoid((-((-i0) - i1))), i2)}} [@A] '' 4
|CGemv{inplace} [@B] '' 3
...
...
@@ -352,18 +358,24 @@ TensorConstant{0.5})'
- Picture Printing of Graphs
``pydotprint`` requires graphviz and pydot.
The graph before optimization:
>>> theano.printing.pydotprint(prediction, outfile="pics/logreg_pydotprint_prediction.png", var_with_name_simple=True)
The output file is available at pics/logreg_pydotprint_prediction.png
.. image:: ./pics/logreg_pydotprint_prediction.png
:width: 800 px
The graph after optimization:
>>> theano.printing.pydotprint(predict, outfile="pics/logreg_pydotprint_predict.png", var_with_name_simple=True)
The output file is available at pics/logreg_pydotprint_predict.png
.. image:: ./pics/logreg_pydotprint_predict.png
:width: 800 px
The optimized training graph:
>>> theano.printing.pydotprint(train, outfile="pics/logreg_pydotprint_train.png", var_with_name_simple=True)
The output file is available at pics/logreg_pydotprint_train.png
...
...
doc/cifarSC2011/pics/logreg_pydotprint_predic.png
deleted
100644 → 0
浏览文件 @
81e6bba0
103.7 KB
doc/hpcs2011_tutorial/pics/f_optimized.png
查看替换文件 @
81e6bba0
浏览文件 @
fa5f3ed9
19.5 KB
|
W:
|
H:
22.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
doc/hpcs2011_tutorial/pics/f_unoptimized.png
查看替换文件 @
81e6bba0
浏览文件 @
fa5f3ed9
50.8 KB
|
W:
|
H:
60.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
doc/hpcs2011_tutorial/simple_example.py
浏览文件 @
fa5f3ed9
...
...
@@ -5,5 +5,5 @@ f = theano.function([a], b) # compile function
print
f
([
0
,
1
,
2
])
# prints `array([0,2,1026])`
theano
.
printing
.
pydotprint
_variables
(
b
,
outfile
=
"pics/f_unoptimized.png"
,
var_with_name_simple
=
True
)
theano
.
printing
.
pydotprint
(
b
,
outfile
=
"pics/f_unoptimized.png"
,
var_with_name_simple
=
True
)
theano
.
printing
.
pydotprint
(
f
,
outfile
=
"pics/f_optimized.png"
,
var_with_name_simple
=
True
)
doc/tutorial/pics/symbolic_graph_unopt.png
0 → 100644
浏览文件 @
fa5f3ed9
60.6 KB
doc/tutorial/symbolic_graphs.txt
浏览文件 @
fa5f3ed9
...
...
@@ -159,12 +159,14 @@ as we apply it. Consider the following example of optimization:
>>> f = theano.function([a], b) # compile function
>>> print f([0, 1, 2]) # prints `array([0,2,1026])`
[ 0. 2. 1026.]
>>> theano.printing.pydotprint(b, outfile="./pics/symbolic_graph_unopt.png", var_with_name_simple=True)
The output file is available at ./pics/symbolic_graph_unopt.png
>>> theano.printing.pydotprint(f, outfile="./pics/symbolic_graph_opt.png", var_with_name_simple=True)
The output file is available at ./pics/symbolic_graph_opt.png
.. |g1| image:: .
./hpcs2011_tutorial/pics/f_unoptimized
.png
:width:
3
00 px
.. |g1| image:: .
/pics/symbolic_graph_unopt
.png
:width:
5
00 px
.. |g2| image:: ./pics/symbolic_graph_opt.png
:width: 500 px
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论