Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7bbbe727
提交
7bbbe727
authored
9月 25, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some things in code review.
上级
fae01b90
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
16 行删除
+23
-16
conv_desc.c
theano/sandbox/gpuarray/conv_desc.c
+1
-1
dnn.py
theano/sandbox/gpuarray/dnn.py
+22
-15
没有找到文件。
theano/sandbox/gpuarray/conv_desc.c
浏览文件 @
7bbbe727
#section support_code_apply
#section support_code_apply
int
conv_desc
(
PyArrayObject
*
filt_shp
,
int
APPLY_SPECIFIC
(
conv_desc
)
(
PyArrayObject
*
filt_shp
,
cudnnConvolutionDescriptor_t
*
desc
)
{
cudnnConvolutionDescriptor_t
*
desc
)
{
cudnnStatus_t
err
;
cudnnStatus_t
err
;
int
pad
[
3
]
=
{
PAD_0
,
PAD_1
,
PAD_2
};
int
pad
[
3
]
=
{
PAD_0
,
PAD_1
,
PAD_2
};
...
...
theano/sandbox/gpuarray/dnn.py
浏览文件 @
7bbbe727
import
os
import
os
import
numpy
import
numpy
import
warnings
import
theano
import
theano
from
theano
import
Op
,
Apply
,
tensor
,
config
,
Variable
from
theano
import
Op
,
Apply
,
tensor
,
config
,
Variable
...
@@ -226,7 +227,7 @@ class GpuDnnConvDesc(COp):
...
@@ -226,7 +227,7 @@ class GpuDnnConvDesc(COp):
return
False
return
False
def
__init__
(
self
,
border_mode
,
subsample
=
(
1
,
1
),
conv_mode
=
'conv'
):
def
__init__
(
self
,
border_mode
,
subsample
=
(
1
,
1
),
conv_mode
=
'conv'
):
COp
.
__init__
(
self
,
[
"conv_desc.c"
],
"
conv_desc
"
)
COp
.
__init__
(
self
,
[
"conv_desc.c"
],
"
APPLY_SPECIFIC(conv_desc)
"
)
if
isinstance
(
border_mode
,
int
):
if
isinstance
(
border_mode
,
int
):
border_mode
=
(
border_mode
,)
*
len
(
subsample
)
border_mode
=
(
border_mode
,)
*
len
(
subsample
)
...
@@ -764,6 +765,11 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
...
@@ -764,6 +765,11 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
work with this Op.
work with this Op.
"""
"""
if
workmem
is
not
None
:
if
algo
is
not
None
:
raise
ValueError
(
"You can't use both algo and workmem"
)
warnings
.
warn
(
"workmem is deprecated, use algo instead"
,
stacklevel
=
2
)
algo
=
workmem
fgraph
=
getattr
(
img
,
'fgraph'
,
None
)
or
getattr
(
kerns
,
'fgraph'
,
None
)
fgraph
=
getattr
(
img
,
'fgraph'
,
None
)
or
getattr
(
kerns
,
'fgraph'
,
None
)
if
(
border_mode
==
'valid'
and
subsample
==
(
1
,
1
)
and
if
(
border_mode
==
'valid'
and
subsample
==
(
1
,
1
)
and
direction_hint
==
'bprop weights'
):
direction_hint
==
'bprop weights'
):
...
@@ -821,18 +827,18 @@ class GpuDnnPoolDesc(Op):
...
@@ -821,18 +827,18 @@ class GpuDnnPoolDesc(Op):
This Op builds a pooling descriptor for use in the other
This Op builds a pooling descriptor for use in the other
pooling operations.
pooling operations.
`ws`, `stride` and `pad` must have the same length.
Parameters
Parameters
----------
----------
ws
ws
: tuple
Window
s
size.
Window size.
stride
stride
: tuple
(dx, dy).
(dx, dy)
or (dx, dy, dz)
.
mode : {'max', 'average_inc_pad', 'average_exc_pad'}
mode : {'max', 'average_inc_pad', 'average_exc_pad'}
The old deprecated name 'average' corresponds to 'average_inc_pad'.
The old deprecated name 'average' corresponds to 'average_inc_pad'.
pad
pad : tuple
(padX, padY) padding information.
(padX, padY) or (padX, padY, padZ)
padX is the size of the left and right borders,
padY is the size of the top and bottom borders.
"""
"""
...
@@ -1044,19 +1050,20 @@ def dnn_pool(img, ws, stride=(1, 1), mode='max', pad=(0, 0)):
...
@@ -1044,19 +1050,20 @@ def dnn_pool(img, ws, stride=(1, 1), mode='max', pad=(0, 0)):
The memory layout to use is 'bc01', that is 'batch', 'channel',
The memory layout to use is 'bc01', that is 'batch', 'channel',
'first dim', 'second dim' in that order.
'first dim', 'second dim' in that order.
`ws`, `stride` and `pad` must have the same length.
Parameters
Parameters
----------
----------
img
img
Images to do the pooling over.
Images to do the pooling over.
ws
ws
: tuple
Subsampling window size.
Subsampling window size.
stride
stride
: tuple
Subsampling stride (default: (1, 1)).
Subsampling stride (default: (1, 1)).
mode : {'max', 'average_inc_pad', 'average_exc_pad'}
mode : {'max', 'average_inc_pad', 'average_exc_pad'}
pad
pad : tuple
(padX, padY) padding information.
(padX, padY) or (padX, padY, padZ)
padX is the size of the left and right borders,
default: (0, 0)
padY is the size of the top and bottom borders.
.. warning:: The cuDNN library only works with GPU that have a compute
.. warning:: The cuDNN library only works with GPU that have a compute
capability of 3.0 or higer. This means that older GPU will not
capability of 3.0 or higer. This means that older GPU will not
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论