Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d66a7734
提交
d66a7734
authored
12月 02, 2015
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Various fixes
- some syntax - In the new backend, GpuDnnConvDesc takes only the kernel shape
上级
041a5d75
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
10 行增加
和
7 行删除
+10
-7
dnn.py
theano/sandbox/gpuarray/dnn.py
+7
-4
test_abstractconv.py
theano/sandbox/gpuarray/tests/test_abstractconv.py
+3
-3
没有找到文件。
theano/sandbox/gpuarray/dnn.py
浏览文件 @
d66a7734
...
@@ -829,7 +829,7 @@ def dnn_gradweight(img, topgrad, kerns_shp, border_mode='valid',
...
@@ -829,7 +829,7 @@ def dnn_gradweight(img, topgrad, kerns_shp, border_mode='valid',
topgrad
=
gpu_contiguous
(
topgrad
)
topgrad
=
gpu_contiguous
(
topgrad
)
kerns_shp
=
as_tensor_variable
(
kerns_shp
)
kerns_shp
=
as_tensor_variable
(
kerns_shp
)
desc
=
GpuDnnConvDesc
(
border_mode
=
border_mode
,
subsample
=
subsample
,
desc
=
GpuDnnConvDesc
(
border_mode
=
border_mode
,
subsample
=
subsample
,
conv_mode
=
conv_mode
)(
img
.
shape
,
kerns_shp
)
conv_mode
=
conv_mode
)(
kerns_shp
)
out
=
GpuAllocEmpty
(
img
.
dtype
,
ctx_name
)(
*
kerns_shp
)
out
=
GpuAllocEmpty
(
img
.
dtype
,
ctx_name
)(
*
kerns_shp
)
return
GpuDnnConvGradW
()(
img
,
topgrad
,
out
,
desc
)
return
GpuDnnConvGradW
()(
img
,
topgrad
,
out
,
desc
)
...
@@ -841,7 +841,7 @@ def dnn_gradinput(kerns, topgrad, img_shp, border_mode='valid',
...
@@ -841,7 +841,7 @@ def dnn_gradinput(kerns, topgrad, img_shp, border_mode='valid',
topgrad
=
gpu_contiguous
(
topgrad
)
topgrad
=
gpu_contiguous
(
topgrad
)
img_shp
=
as_tensor_variable
(
img_shp
)
img_shp
=
as_tensor_variable
(
img_shp
)
desc
=
GpuDnnConvDesc
(
border_mode
=
border_mode
,
subsample
=
subsample
,
desc
=
GpuDnnConvDesc
(
border_mode
=
border_mode
,
subsample
=
subsample
,
conv_mode
=
conv_mode
)(
img_shp
,
kerns
.
shape
)
conv_mode
=
conv_mode
)(
kerns
.
shape
)
out
=
GpuAllocEmpty
(
kerns
.
dtype
,
ctx_name
)(
*
img_shp
)
out
=
GpuAllocEmpty
(
kerns
.
dtype
,
ctx_name
)(
*
img_shp
)
return
GpuDnnConvGradI
()(
kerns
,
topgrad
,
out
,
desc
)
return
GpuDnnConvGradI
()(
kerns
,
topgrad
,
out
,
desc
)
...
@@ -1228,7 +1228,7 @@ def local_abstractconv_cudnn(node):
...
@@ -1228,7 +1228,7 @@ def local_abstractconv_cudnn(node):
not
isinstance
(
inp2
.
type
,
GpuArrayType
)):
not
isinstance
(
inp2
.
type
,
GpuArrayType
)):
return
None
return
None
if
not
dnn_available
():
if
not
dnn_available
(
inp1
.
type
.
context_name
):
return
None
return
None
if
node
.
op
.
filter_flip
:
if
node
.
op
.
filter_flip
:
...
@@ -1258,7 +1258,10 @@ def local_abstractconv_cudnn(node):
...
@@ -1258,7 +1258,10 @@ def local_abstractconv_cudnn(node):
conv_mode
=
conv_mode
)
conv_mode
=
conv_mode
)
return
[
rval
]
return
[
rval
]
conv_groupopt
.
register
(
local_abstractconv_cudnn
)
conv_groupopt
.
register
(
'local_abstractconv_cudnn'
,
local_abstractconv_cudnn
,
20
,
'fast_compile'
,
'fast_run'
,
'gpuarray'
,
'conv_dnn'
,
'cudnn'
)
@inplace_allocempty
(
GpuDnnConv
,
2
)
@inplace_allocempty
(
GpuDnnConv
,
2
)
...
...
theano/sandbox/gpuarray/tests/test_abstractconv.py
浏览文件 @
d66a7734
...
@@ -6,9 +6,9 @@ from nose.plugins.skip import SkipTest
...
@@ -6,9 +6,9 @@ from nose.plugins.skip import SkipTest
import
theano
import
theano
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests
import
unittest_tools
as
utt
import
theano.tensor.nnet.abstract_conv
2d
as
conv
import
theano.tensor.nnet.abstract_conv
as
conv
from
theano.compile
import
shared
as
cpu_shared
from
theano.compile
import
shared
as
cpu_shared
from
..type
import
gpuarray_shared_contructor
as
gpu_shared
from
..type
import
gpuarray_shared_con
s
tructor
as
gpu_shared
from
..dnn
import
dnn_available
,
dnn_conv
,
dnn_gradweight
,
dnn_gradinput
from
..dnn
import
dnn_available
,
dnn_conv
,
dnn_gradweight
,
dnn_gradinput
from
.config
import
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
from
.config
import
mode_with_gpu
,
mode_without_gpu
,
test_ctx_name
...
@@ -39,7 +39,7 @@ class TestConv2d(unittest.TestCase):
...
@@ -39,7 +39,7 @@ class TestConv2d(unittest.TestCase):
else
((
i
+
2
*
pad
-
k
)
//
d
+
1
)
else
((
i
+
2
*
pad
-
k
)
//
d
+
1
)
for
i
,
k
,
d
,
pad
in
zip
(
inputs_shape
[
2
:],
for
i
,
k
,
d
,
pad
in
zip
(
inputs_shape
[
2
:],
filters_shape
[
2
:],
filters_shape
[
2
:],
subsample
,
border_mode
))
subsample
,
border_mode
))
)
def
run_fwd
(
self
,
inputs_shape
,
filters_shape
,
ref
=
dnn_conv
,
def
run_fwd
(
self
,
inputs_shape
,
filters_shape
,
ref
=
dnn_conv
,
subsample
=
(
1
,
1
),
verify_grad
=
True
,
mode
=
mode_without_gpu
,
subsample
=
(
1
,
1
),
verify_grad
=
True
,
mode
=
mode_without_gpu
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论