Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
91f71351
提交
91f71351
authored
8月 04, 2015
作者:
--global
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pep8
上级
d36faf23
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
12 行删除
+11
-12
test_dnn.py
theano/sandbox/cuda/tests/test_dnn.py
+11
-12
没有找到文件。
theano/sandbox/cuda/tests/test_dnn.py
浏览文件 @
91f71351
...
@@ -1060,8 +1060,7 @@ def test_dnn_conv_grad():
...
@@ -1060,8 +1060,7 @@ def test_dnn_conv_grad():
def
get_conv3d_test_cases
():
def
get_conv3d_test_cases
():
# Every element of test_shapes follows the format
# Every element of test_shapes follows the format
# [input_shape, filter_shape, subsample]
# [input_shape, filter_shape, subsample]
test_shapes
=
[
# Test with standard size inputs and kernels
test_shapes
=
[[(
128
,
3
,
5
,
5
,
5
),
(
64
,
3
,
1
,
2
,
4
),
(
1
,
1
,
1
)],
[(
128
,
3
,
5
,
5
,
5
),
(
64
,
3
,
1
,
2
,
4
),
(
1
,
1
,
1
)],
[(
8
,
4
,
20
,
12
,
15
),
(
5
,
4
,
6
,
12
,
4
),
(
2
,
2
,
2
)],
[(
8
,
4
,
20
,
12
,
15
),
(
5
,
4
,
6
,
12
,
4
),
(
2
,
2
,
2
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
12
,
4
),
(
3
,
3
,
3
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
12
,
4
),
(
3
,
3
,
3
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
12
,
4
),
(
3
,
2
,
1
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
12
,
4
),
(
3
,
2
,
1
)],
...
@@ -1154,9 +1153,9 @@ def test_conv3d_fwd():
...
@@ -1154,9 +1153,9 @@ def test_conv3d_fwd():
# Compile a theano function for the reference implementation
# Compile a theano function for the reference implementation
conv_ref
=
theano
.
tensor
.
nnet
.
conv3D
(
conv_ref
=
theano
.
tensor
.
nnet
.
conv3D
(
V
=
padded_inputs
.
dimshuffle
(
0
,
2
,
3
,
4
,
1
),
V
=
padded_inputs
.
dimshuffle
(
0
,
2
,
3
,
4
,
1
),
W
=
flipped_filters
.
dimshuffle
(
0
,
2
,
3
,
4
,
1
),
W
=
flipped_filters
.
dimshuffle
(
0
,
2
,
3
,
4
,
1
),
b
=
bias
,
d
=
subsample
)
b
=
bias
,
d
=
subsample
)
f_ref
=
theano
.
function
([],
conv_ref
.
dimshuffle
(
0
,
4
,
1
,
2
,
3
))
f_ref
=
theano
.
function
([],
conv_ref
.
dimshuffle
(
0
,
4
,
1
,
2
,
3
))
# Compare the results of the two implementations
# Compare the results of the two implementations
...
@@ -1222,9 +1221,9 @@ def test_conv3d_bwd():
...
@@ -1222,9 +1221,9 @@ def test_conv3d_bwd():
# Compile a theano function for the reference implementation
# Compile a theano function for the reference implementation
conv_ref
=
theano
.
tensor
.
nnet
.
conv3D
(
conv_ref
=
theano
.
tensor
.
nnet
.
conv3D
(
V
=
padded_inputs
.
dimshuffle
(
0
,
2
,
3
,
4
,
1
),
V
=
padded_inputs
.
dimshuffle
(
0
,
2
,
3
,
4
,
1
),
W
=
flipped_filters
.
dimshuffle
(
0
,
2
,
3
,
4
,
1
),
W
=
flipped_filters
.
dimshuffle
(
0
,
2
,
3
,
4
,
1
),
b
=
bias
,
d
=
subsample
)
b
=
bias
,
d
=
subsample
)
(
grad_padded_i_ref
,
(
grad_padded_i_ref
,
grad_w_ref
)
=
theano
.
tensor
.
grad
(
conv_ref
.
sum
(),
grad_w_ref
)
=
theano
.
tensor
.
grad
(
conv_ref
.
sum
(),
[
padded_inputs
,
filters
])
[
padded_inputs
,
filters
])
...
@@ -1235,10 +1234,10 @@ def test_conv3d_bwd():
...
@@ -1235,10 +1234,10 @@ def test_conv3d_bwd():
else
:
else
:
shp
=
grad_padded_i_ref
.
shape
shp
=
grad_padded_i_ref
.
shape
grad_i_ref
=
grad_padded_i_ref
[
grad_i_ref
=
grad_padded_i_ref
[
:,
:,
:,
:,
pad_per_dim
[
0
]:
shp
[
2
]
-
pad_per_dim
[
0
],
pad_per_dim
[
0
]:
shp
[
2
]
-
pad_per_dim
[
0
],
pad_per_dim
[
1
]:
shp
[
3
]
-
pad_per_dim
[
1
],
pad_per_dim
[
1
]:
shp
[
3
]
-
pad_per_dim
[
1
],
pad_per_dim
[
2
]:
shp
[
4
]
-
pad_per_dim
[
2
]]
pad_per_dim
[
2
]:
shp
[
4
]
-
pad_per_dim
[
2
]]
f_ref
=
theano
.
function
([],
[
grad_i_ref
,
grad_w_ref
])
f_ref
=
theano
.
function
([],
[
grad_i_ref
,
grad_w_ref
])
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论