Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f217371f
提交
f217371f
authored
8月 22, 2014
作者:
f0k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cut down GpuCorrMM gradients test to about 5 minutes
上级
1477ded8
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
10 行删除
+19
-10
test_conv_cuda_ndarray.py
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
+19
-10
没有找到文件。
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
浏览文件 @
f217371f
...
@@ -895,15 +895,15 @@ def test_gemm_directly():
...
@@ -895,15 +895,15 @@ def test_gemm_directly():
def
test_gemm_grads
():
def
test_gemm_grads
():
for
mode
in
'valid'
,
'full'
:
for
mode
in
'valid'
,
'full'
:
for
bs
in
[
1
,
4
,
5
]:
for
bs
in
[
1
,
5
]:
for
ch
in
range
(
1
,
4
)
:
for
ch
in
[
4
]
:
for
nf
in
range
(
1
,
4
)
:
for
nf
in
[
3
]
:
for
rImg1
in
[
2
,
5
,
8
]:
for
rImg1
in
[
2
,
5
]:
for
rImg2
in
[
2
,
5
,
8
]:
for
rImg2
in
[
2
,
8
]:
for
rFlt1
in
[
1
,
2
]:
for
rFlt1
in
[
1
,
2
]:
for
rFlt2
in
[
1
,
2
]:
for
rFlt2
in
[
1
,
2
]:
for
subsx
in
range
(
1
,
3
)
:
for
subsx
in
[
1
,
2
]
:
for
subsy
in
range
(
1
,
3
)
:
for
subsy
in
[
1
,
2
]
if
subsx
==
1
else
[
2
]
:
ishape
=
(
bs
,
ch
,
rImg1
,
rImg2
)
ishape
=
(
bs
,
ch
,
rImg1
,
rImg2
)
kshape
=
(
nf
,
ch
,
rFlt1
,
rFlt2
)
kshape
=
(
nf
,
ch
,
rFlt1
,
rFlt2
)
subsample
=
(
subsx
,
subsy
)
subsample
=
(
subsx
,
subsy
)
...
@@ -918,12 +918,21 @@ def test_gemm_grads():
...
@@ -918,12 +918,21 @@ def test_gemm_grads():
# TODO: also test custom pad values
# TODO: also test custom pad values
corr_op
=
theano
.
sandbox
.
cuda
.
blas
.
GpuCorrMM
(
corr_op
=
theano
.
sandbox
.
cuda
.
blas
.
GpuCorrMM
(
'valid'
,
subsample
,
pad
)(
i
,
k
)
'valid'
,
subsample
,
pad
)(
i
,
k
)
# try to compile reference implementation without shape,
# so we don't have to compile hundreds of versions
conv_op
=
tensor
.
nnet
.
conv2d
(
i
,
k
[:,:,::
-
1
,::
-
1
],
conv_op
=
tensor
.
nnet
.
conv2d
(
i
,
k
[:,:,::
-
1
,::
-
1
],
ishape
,
kshape
,
mode
,
subsample
)
border_mode
=
mode
,
subsample
=
subsample
)
try
:
conv_op_di
=
theano
.
grad
(
conv_op
.
sum
(),
i
)
conv_op_dk
=
theano
.
grad
(
conv_op
.
sum
(),
k
)
except
Exception
:
# compile with shape information only when needed
conv_op
=
tensor
.
nnet
.
conv2d
(
i
,
k
[:,:,::
-
1
,::
-
1
],
ishape
,
kshape
,
mode
,
subsample
)
conv_op_di
=
theano
.
grad
(
conv_op
.
sum
(),
i
)
conv_op_dk
=
theano
.
grad
(
conv_op
.
sum
(),
k
)
corr_op_di
=
theano
.
grad
(
corr_op
.
sum
(),
i
)
corr_op_di
=
theano
.
grad
(
corr_op
.
sum
(),
i
)
conv_op_di
=
theano
.
grad
(
conv_op
.
sum
(),
i
)
corr_op_dk
=
theano
.
grad
(
corr_op
.
sum
(),
k
)
corr_op_dk
=
theano
.
grad
(
corr_op
.
sum
(),
k
)
conv_op_dk
=
theano
.
grad
(
conv_op
.
sum
(),
k
)
outputs
=
[
corr_op
,
conv_op
,
outputs
=
[
corr_op
,
conv_op
,
corr_op_di
,
conv_op_di
,
corr_op_di
,
conv_op_di
,
corr_op_dk
,
conv_op_dk
]
corr_op_dk
,
conv_op_dk
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论