Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ef9e88ed
提交
ef9e88ed
authored
9月 17, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use assert_allclose instead of numpy.allclose().
上级
de021dcf
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
10 行删除
+6
-10
test_nnet.py
theano/sandbox/gpuarray/tests/test_nnet.py
+6
-10
没有找到文件。
theano/sandbox/gpuarray/tests/test_nnet.py
浏览文件 @
ef9e88ed
...
@@ -85,13 +85,9 @@ def test_GpuCrossentropySoftmaxArgmax1HotWithBias():
...
@@ -85,13 +85,9 @@ def test_GpuCrossentropySoftmaxArgmax1HotWithBias():
gout
=
classify_gpu
(
yy
,
b_values
,
dot_value
)
gout
=
classify_gpu
(
yy
,
b_values
,
dot_value
)
assert
len
(
out
)
==
len
(
gout
)
==
3
assert
len
(
out
)
==
len
(
gout
)
==
3
assert
numpy
.
allclose
(
out
[
0
],
gout
[
0
])
utt
.
assert_allclose
(
out
[
0
],
gout
[
0
])
assert
numpy
.
allclose
(
out
[
2
],
gout
[
2
],
atol
=
3e-6
),
numpy
.
absolute
(
utt
.
assert_allclose
(
out
[
2
],
gout
[
2
],
atol
=
3e-6
)
gout
[
2
]
-
out
[
2
])
.
max
()
utt
.
assert_allclose
(
out
[
1
],
gout
[
1
])
assert
numpy
.
allclose
(
out
[
1
],
gout
[
1
]),
[(
id
,
out
[
1
][
id
],
gout
[
1
][
id
],
val
)
for
id
,
val
in
enumerate
(
out
[
1
]
-
gout
[
1
])
if
val
!=
0
]
def
test_GpuCrossentropySoftmax1HotWithBiasDx
():
def
test_GpuCrossentropySoftmax1HotWithBiasDx
():
...
@@ -211,7 +207,7 @@ def softmax_with_bias_unittest_template(dtypeInput, dtypeBias):
...
@@ -211,7 +207,7 @@ def softmax_with_bias_unittest_template(dtypeInput, dtypeBias):
out
=
f
(
data
)
out
=
f
(
data
)
gout
=
f_gpu
(
data
)
gout
=
f_gpu
(
data
)
assert
numpy
.
allclose
(
out
,
gout
),
numpy
.
absolute
(
out
-
gout
)
utt
.
assert_allclose
(
out
,
gout
)
cmp
(
2
,
5
)
cmp
(
2
,
5
)
# we need to test n>32*1024 to check that we make the block loop.
# we need to test n>32*1024 to check that we make the block loop.
...
@@ -262,7 +258,7 @@ def softmax_unittest_template(dtypeInput):
...
@@ -262,7 +258,7 @@ def softmax_unittest_template(dtypeInput):
out
=
f
(
data
)
out
=
f
(
data
)
gout
=
f_gpu
(
data
)
gout
=
f_gpu
(
data
)
assert
numpy
.
allclose
(
out
,
gout
),
numpy
.
absolute
(
out
-
gout
)
utt
.
assert_allclose
(
out
,
gout
)
# we need to test n>32*1024 to check that we make the block loop.
# we need to test n>32*1024 to check that we make the block loop.
cmp
(
2
,
5
)
cmp
(
2
,
5
)
...
@@ -337,7 +333,7 @@ class test_SoftMax(unittest.TestCase):
...
@@ -337,7 +333,7 @@ class test_SoftMax(unittest.TestCase):
data
=
numpy
.
arange
(
n
*
m
,
dtype
=
'float32'
)
.
reshape
(
n
,
m
)
data
=
numpy
.
arange
(
n
*
m
,
dtype
=
'float32'
)
.
reshape
(
n
,
m
)
out
=
f
(
data
)
out
=
f
(
data
)
gout
=
f_gpu
(
data
)
gout
=
f_gpu
(
data
)
assert
numpy
.
allclose
(
out
,
gout
),
numpy
.
absolute
(
out
-
gout
)
utt
.
assert_allclose
(
out
,
gout
)
def
_check_types
(
self
,
graph
,
graph_gpu
,
f_type
,
f_gpu_type
):
def
_check_types
(
self
,
graph
,
graph_gpu
,
f_type
,
f_gpu_type
):
assert
isinstance
(
graph
.
maker
.
fgraph
.
toposort
()[
-
1
]
.
op
,
f_type
)
assert
isinstance
(
graph
.
maker
.
fgraph
.
toposort
()[
-
1
]
.
op
,
f_type
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论