Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
46f64a65
提交
46f64a65
authored
8月 01, 2014
作者:
Arjun Jain
浏览文件
操作
浏览文件
下载
差异文件
Merge commit 'refs/pullreqs/origin/pr/2' into conv_gemm after Fred's commit…
Merge commit 'refs/pullreqs/origin/pr/2' into conv_gemm after Fred's commit which said valid finally works.
上级
5174e479
b6febcb9
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
10 行删除
+18
-10
conv_gemm.cu
theano/sandbox/cuda/conv_gemm.cu
+9
-6
opt.py
theano/sandbox/cuda/opt.py
+0
-1
test_conv_cuda_ndarray.py
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
+9
-3
没有找到文件。
theano/sandbox/cuda/conv_gemm.cu
浏览文件 @
46f64a65
...
@@ -103,21 +103,24 @@ CudaNdarray* validMM(const CudaNdarray *input,
...
@@ -103,21 +103,24 @@ CudaNdarray* validMM(const CudaNdarray *input,
// filters: (number of filters, nInputPlane, rows, columns)
// filters: (number of filters, nInputPlane, rows, columns)
int nOutputPlane = CudaNdarray_HOST_DIMS(weight)[0];
int nOutputPlane = CudaNdarray_HOST_DIMS(weight)[0];
long batchSize = CudaNdarray_HOST_DIMS(input)[0];
long batchSize = CudaNdarray_HOST_DIMS(input)[0];
if (kW != kH){
if (CudaNdarray_HOST_DIMS(input)[2] != CudaNdarray_HOST_DIMS(input)[3]){
PyErr_SetString(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"GpuConvMM support only square kernel\n"
"GpuConvMM support only square images. Got %dx%d images\n",
CudaNdarray_HOST_DIMS(input)[2],
CudaNdarray_HOST_DIMS(input)[3]
);
);
return NULL;
return NULL;
}
}
if (kW != kH){
if (kW != kH){
PyErr_SetString(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"GpuConvMM support only square images\n"
"GpuConvMM support only square kernel. Got %dx%d kernel\n",
kW, kH
);
);
return NULL;
return NULL;
}
}
if (CudaNdarray_HOST_DIMS(input)[1] != CudaNdarray_HOST_DIMS(weight)[1]){
if (CudaNdarray_HOST_DIMS(input)[1] != CudaNdarray_HOST_DIMS(weight)[1]){
PyErr_SetString(PyExc_ValueError,
PyErr_SetString(PyExc_ValueError,
"GpuConvMM
support only square images
\n"
"GpuConvMM
images and kernel must have the same stack size
\n"
);
);
return NULL;
return NULL;
}
}
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
46f64a65
...
@@ -1288,7 +1288,6 @@ def local_conv_gemm(node):
...
@@ -1288,7 +1288,6 @@ def local_conv_gemm(node):
if
(
isinstance
(
node
.
op
,
GpuConv
)
and
if
(
isinstance
(
node
.
op
,
GpuConv
)
and
node
.
op
.
border_mode
==
'valid'
and
node
.
op
.
border_mode
==
'valid'
and
node
.
op
.
subsample
==
(
1
,
1
)):
node
.
op
.
subsample
==
(
1
,
1
)):
print
"WARNING, YOU ARE USING BUGGED CODE!"
img
,
kern
=
node
.
inputs
img
,
kern
=
node
.
inputs
img
=
gpu_contiguous
(
img
)
img
=
gpu_contiguous
(
img
)
kern
=
kern
[:,
:,
::
-
1
,
::
-
1
]
kern
=
kern
[:,
:,
::
-
1
,
::
-
1
]
...
...
theano/sandbox/cuda/tests/test_conv_cuda_ndarray.py
浏览文件 @
46f64a65
...
@@ -637,9 +637,15 @@ def test_valid():
...
@@ -637,9 +637,15 @@ def test_valid():
mode
=
theano_mode
.
including
(
"conv_gemm"
)
mode
=
theano_mode
.
including
(
"conv_gemm"
)
# Remove case not implemented
version
=
[
-
1
]
shapes
=
[
shp
for
shp
in
shapes
if
shp
[
1
][
2
]
==
shp
[
1
][
3
]]
# Remove case not supported
shapes
=
[
shp
for
shp
in
shapes
if
shp
[
0
][
2
]
==
shp
[
0
][
3
]]
# Add tests with strided inputs by still square images and filters.
shapes
+=
get_shapes2
(
scales_img
=
(
2
,
2
),
img_stride
=
(
2
,
2
))
shapes
+=
get_shapes2
(
scales_kern
=
(
2
,
2
),
kern_stride
=
(
2
,
2
))
# Keep only tests with square images and filters even with inputs strides
shapes
=
[
shp
for
shp
in
shapes
if
(
shp
[
0
][
2
]
/
shp
[
3
][
0
]
==
shp
[
0
][
3
]
/
shp
[
3
][
1
]
and
shp
[
1
][
2
]
/
shp
[
4
][
0
]
==
shp
[
1
][
3
]
/
shp
[
4
][
1
])]
exec_conv
(
version
,
shapes
,
verbose
,
random
,
'valid'
,
exec_conv
(
version
,
shapes
,
verbose
,
random
,
'valid'
,
print_
=
print_
,
ones
=
ones
,
rtol
=
1.1e-5
,
print_
=
print_
,
ones
=
ones
,
rtol
=
1.1e-5
,
theano_mode
=
mode
,
cls
=
cuda
.
blas
.
GpuConvMM
)
theano_mode
=
mode
,
cls
=
cuda
.
blas
.
GpuConvMM
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论