Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8560b2ca
提交
8560b2ca
authored
8月 01, 2017
作者:
Pascal Lamblin
提交者:
GitHub
8月 01, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6199 from abergeron/fix_buildbot
Fix some problems in the daily buildbot in DEBUG_MODE.
上级
ec3ac585
9706d06e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
5 行增加
和
9 行删除
+5
-9
debugmode.py
theano/compile/debugmode.py
+4
-8
test_bn.py
theano/tensor/nnet/tests/test_bn.py
+1
-1
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
8560b2ca
...
@@ -28,6 +28,7 @@ from theano.compile.function_module import (
...
@@ -28,6 +28,7 @@ from theano.compile.function_module import (
std_fgraph
)
std_fgraph
)
from
theano.compile.mode
import
Mode
,
register_mode
from
theano.compile.mode
import
Mode
,
register_mode
from
theano.compile.ops
import
OutputGuard
,
_output_guard
from
theano.compile.ops
import
OutputGuard
,
_output_guard
from
theano.configparser
import
change_flags
__docformat__
=
"restructuredtext en"
__docformat__
=
"restructuredtext en"
...
@@ -2227,17 +2228,11 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
...
@@ -2227,17 +2228,11 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
inputs
,
outputs
,
accept_inplace
)
inputs
,
outputs
,
accept_inplace
)
fgraph
.
equivalence_tracker
=
equivalence_tracker
fgraph
.
equivalence_tracker
=
equivalence_tracker
# optimize the fgraph
with
change_flags
(
compute_test_value
=
config
.
compute_test_value_opt
):
compute_test_value_orig
=
theano
.
config
.
compute_test_value
try
:
theano
.
config
.
compute_test_value
=
\
theano
.
config
.
compute_test_value_opt
optimizer
(
fgraph
)
optimizer
(
fgraph
)
theano
.
compile
.
function_module
.
insert_deepcopy
(
theano
.
compile
.
function_module
.
insert_deepcopy
(
fgraph
,
inputs
,
list
(
chain
(
outputs
,
additional_outputs
)))
fgraph
,
inputs
,
list
(
chain
(
outputs
,
additional_outputs
)))
finally
:
theano
.
config
.
compute_test_value
=
compute_test_value_orig
if
i
==
0
:
if
i
==
0
:
fgraph0
=
fgraph
fgraph0
=
fgraph
...
@@ -2286,7 +2281,8 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
...
@@ -2286,7 +2281,8 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
fgraph
.
attach_feature
(
gof
.
DestroyHandler
())
fgraph
.
attach_feature
(
gof
.
DestroyHandler
())
for
o
in
fgraph
.
outputs
:
for
o
in
fgraph
.
outputs
:
try
:
try
:
fgraph
.
replace_validate
(
o
,
_output_guard
(
o
),
reason
=
'output_guard'
)
with
change_flags
(
compute_test_value
=
config
.
compute_test_value_opt
):
fgraph
.
replace_validate
(
o
,
_output_guard
(
o
),
reason
=
'output_guard'
)
raise
Exception
(
"Output variable
%
s required output_guard, "
raise
Exception
(
"Output variable
%
s required output_guard, "
"how was this output left unprotected against "
"how was this output left unprotected against "
"destructive operations?"
%
o
)
"destructive operations?"
%
o
)
...
...
theano/tensor/nnet/tests/test_bn.py
浏览文件 @
8560b2ca
...
@@ -293,7 +293,7 @@ def test_batch_normalization_train_grad_grad():
...
@@ -293,7 +293,7 @@ def test_batch_normalization_train_grad_grad():
x_mean_val
=
np
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float64'
)
x_mean_val
=
np
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float64'
)
x_invstd_val
=
np
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float64'
)
x_invstd_val
=
np
.
random
.
randn
(
*
param_shape
)
.
astype
(
'float64'
)
utt
.
verify_grad
(
bn_grad_wrt_inputs_f
,
[
x_val
,
dy_val
,
scale_val
,
x_mean_val
,
x_invstd_val
])
utt
.
verify_grad
(
bn_grad_wrt_inputs_f
,
[
x_val
,
dy_val
,
scale_val
,
x_mean_val
,
x_invstd_val
]
,
abs_tol
=
5e-4
,
rel_tol
=
5e-4
)
utt
.
verify_grad
(
bn_grad_wrt_scale_f
,
[
x_val
,
dy_val
,
scale_val
,
x_mean_val
,
x_invstd_val
])
utt
.
verify_grad
(
bn_grad_wrt_scale_f
,
[
x_val
,
dy_val
,
scale_val
,
x_mean_val
,
x_invstd_val
])
utt
.
verify_grad
(
bn_grad_wrt_bias_f
,
[
x_val
,
dy_val
,
scale_val
,
x_mean_val
,
x_invstd_val
])
utt
.
verify_grad
(
bn_grad_wrt_bias_f
,
[
x_val
,
dy_val
,
scale_val
,
x_mean_val
,
x_invstd_val
])
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论