Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
76b4f47a
提交
76b4f47a
authored
11月 26, 2016
作者:
Gijs van Tulder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tests for arbitrary inputs should now raise errors.
上级
297da372
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
40 行增加
和
18 行删除
+40
-18
test_abstract_conv.py
theano/tensor/nnet/tests/test_abstract_conv.py
+40
-18
没有找到文件。
theano/tensor/nnet/tests/test_abstract_conv.py
浏览文件 @
76b4f47a
...
@@ -472,13 +472,10 @@ class BaseTestConv2d(BaseTestConv):
...
@@ -472,13 +472,10 @@ class BaseTestConv2d(BaseTestConv):
filter_shape
=
(
2
,
1
,
3
,
3
)
filter_shape
=
(
2
,
1
,
3
,
3
)
for
output_shape
in
[(
2
,
2
,
8
,
8
),
(
2
,
2
,
9
,
9
),
(
2
,
2
,
12
,
12
)]:
for
output_shape
in
[(
2
,
2
,
8
,
8
),
(
2
,
2
,
9
,
9
),
(
2
,
2
,
12
,
12
)]:
for
border_mode
in
[
"valid"
,
"half"
,
"full"
]:
for
border_mode
in
[
"valid"
,
"half"
,
"full"
]:
# is this output shape large enough?
computed_shape
=
get_conv_output_shape
(
min_output_shape
=
self
.
get_output_shape
(
input_shape
,
filter_shape
,
border_mode
,
self
.
default_subsamples
,
self
.
default_filters_dilations
)
input_shape
,
filter_shape
,
self
.
default_subsamples
,
# is this a valid combination?
border_mode
,
self
.
default_filters_dilations
)
if
tuple
(
computed_shape
)
==
output_shape
:
if
not
all
(
o
>=
min_o
for
(
o
,
min_o
)
in
zip
(
output_shape
,
min_output_shape
)):
continue
for
provide_shape
in
self
.
provide_shape
:
yield
(
self
.
tcase_gi
,
yield
(
self
.
tcase_gi
,
input_shape
,
input_shape
,
filter_shape
,
filter_shape
,
...
@@ -486,8 +483,21 @@ class BaseTestConv2d(BaseTestConv):
...
@@ -486,8 +483,21 @@ class BaseTestConv2d(BaseTestConv):
self
.
default_subsamples
,
self
.
default_subsamples
,
border_mode
,
border_mode
,
True
,
True
,
provide_shape
,
True
,
self
.
default_filters_dilations
)
self
.
default_filters_dilations
,
False
)
else
:
# expect an error
yield
(
self
.
tcase_gi
,
input_shape
,
filter_shape
,
output_shape
,
self
.
default_subsamples
,
border_mode
,
True
,
True
,
self
.
default_filters_dilations
,
True
)
def
test_gradinput_impossible_output_shapes
(
self
):
def
test_gradinput_impossible_output_shapes
(
self
):
for
i
in
range
(
1
,
20
):
for
i
in
range
(
1
,
20
):
...
@@ -505,6 +515,7 @@ class BaseTestConv2d(BaseTestConv):
...
@@ -505,6 +515,7 @@ class BaseTestConv2d(BaseTestConv):
# outputs that are too large or too small should be rejected
# outputs that are too large or too small should be rejected
for
o
in
(
-
3
,
-
2
,
-
1
,
1
,
2
,
3
):
for
o
in
(
-
3
,
-
2
,
-
1
,
1
,
2
,
3
):
output_shape
=
(
1
,
1
,
computed_shape
[
2
]
+
o
,
computed_shape
[
3
]
+
o
)
output_shape
=
(
1
,
1
,
computed_shape
[
2
]
+
o
,
computed_shape
[
3
]
+
o
)
# expect an error
yield
(
self
.
tcase_gi
,
yield
(
self
.
tcase_gi
,
image_shape
,
image_shape
,
kernel_shape
,
kernel_shape
,
...
@@ -822,13 +833,11 @@ class BaseTestConv3d(BaseTestConv):
...
@@ -822,13 +833,11 @@ class BaseTestConv3d(BaseTestConv):
filter_shape
=
(
1
,
1
,
3
,
3
,
3
)
filter_shape
=
(
1
,
1
,
3
,
3
,
3
)
for
output_shape
in
[(
2
,
1
,
8
,
8
,
8
),
(
2
,
1
,
9
,
9
,
9
),
(
2
,
1
,
12
,
12
,
12
)]:
for
output_shape
in
[(
2
,
1
,
8
,
8
,
8
),
(
2
,
1
,
9
,
9
,
9
),
(
2
,
1
,
12
,
12
,
12
)]:
for
border_mode
in
[
"valid"
,
"half"
,
"full"
]:
for
border_mode
in
[
"valid"
,
"half"
,
"full"
]:
# is this output shape large enough?
# compute the output that these inputs and parameters would produce
min_output_shape
=
self
.
get_output_shape
(
computed_shape
=
get_conv_output_shape
(
input_shape
,
filter_shape
,
self
.
default_subsamples
,
input_shape
,
filter_shape
,
border_mode
,
self
.
default_subsamples
,
self
.
default_filters_dilations
)
border_mode
,
self
.
default_filters_dilations
)
# is this a valid combination?
if
not
all
(
o
>=
min_o
for
(
o
,
min_o
)
in
zip
(
output_shape
,
min_output_shape
)):
if
tuple
(
computed_shape
)
==
output_shape
:
continue
for
provide_shape
in
self
.
provide_shape
:
yield
(
self
.
tcase_gi
,
yield
(
self
.
tcase_gi
,
input_shape
,
input_shape
,
filter_shape
,
filter_shape
,
...
@@ -836,8 +845,21 @@ class BaseTestConv3d(BaseTestConv):
...
@@ -836,8 +845,21 @@ class BaseTestConv3d(BaseTestConv):
self
.
default_subsamples
,
self
.
default_subsamples
,
border_mode
,
border_mode
,
True
,
True
,
provide_shape
,
True
,
self
.
default_filters_dilations
)
self
.
default_filters_dilations
,
False
)
else
:
# expect an error
yield
(
self
.
tcase_gi
,
input_shape
,
filter_shape
,
output_shape
,
self
.
default_subsamples
,
border_mode
,
True
,
True
,
self
.
default_filters_dilations
,
True
)
def
test_gradinput_impossible_output_shapes
(
self
):
def
test_gradinput_impossible_output_shapes
(
self
):
for
i
in
range
(
1
,
20
):
for
i
in
range
(
1
,
20
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论