Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
9f44af9d
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9f44af9d
编写于
12月 11, 2017
作者:
Y
Yu Yang
提交者:
GitHub
12月 11, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #6460 (#6461)
上级
95924686
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
7 deletion
+13
-7
python/paddle/v2/fluid/layers.py
python/paddle/v2/fluid/layers.py
+13
-7
未找到文件。
python/paddle/v2/fluid/layers.py
浏览文件 @
9f44af9d
...
...
@@ -762,7 +762,7 @@ def sequence_conv(input,
helper
=
LayerHelper
(
'sequence_conv'
,
**
locals
())
dtype
=
helper
.
input_dtype
()
filter_shape
=
[
filter_size
*
input
.
shape
[
1
],
num_filters
]
filter
=
helper
.
create_parameter
(
filter
_param
=
helper
.
create_parameter
(
attr
=
helper
.
param_attr
,
shape
=
filter_shape
,
dtype
=
dtype
)
pre_bias
=
helper
.
create_tmp_variable
(
dtype
)
...
...
@@ -770,7 +770,7 @@ def sequence_conv(input,
type
=
'sequence_conv'
,
inputs
=
{
'X'
:
[
input
],
'Filter'
:
[
filter
],
'Filter'
:
[
filter
_param
],
},
outputs
=
{
"Out"
:
pre_bias
},
attrs
=
{
...
...
@@ -785,7 +785,7 @@ def sequence_conv(input,
def
conv2d
(
input
,
num_filters
,
filter_size
,
stride
=
[
1
,
1
]
,
stride
=
None
,
padding
=
None
,
groups
=
None
,
param_attr
=
None
,
...
...
@@ -802,6 +802,8 @@ def conv2d(input,
conv-2d output, if mentioned in the input parameters.
"""
if
stride
is
None
:
stride
=
[
1
,
1
]
helper
=
LayerHelper
(
'conv2d'
,
**
locals
())
dtype
=
helper
.
input_dtype
()
...
...
@@ -827,7 +829,7 @@ def conv2d(input,
std
=
(
2.0
/
(
filter_size
[
0
]
**
2
*
num_channels
))
**
0.5
return
Normal
(
0.0
,
std
,
0
)
filter
=
helper
.
create_parameter
(
filter
_param
=
helper
.
create_parameter
(
attr
=
helper
.
param_attr
,
shape
=
filter_shape
,
dtype
=
dtype
,
...
...
@@ -839,7 +841,7 @@ def conv2d(input,
type
=
'conv2d_cudnn'
,
inputs
=
{
'Input'
:
input
,
'Filter'
:
filter
,
'Filter'
:
filter
_param
,
},
outputs
=
{
"Output"
:
pre_bias
},
attrs
=
{
'strides'
:
stride
,
...
...
@@ -875,8 +877,8 @@ def sequence_pool(input, pool_type, **kwargs):
def
pool2d
(
input
,
pool_size
,
pool_type
,
pool_stride
=
[
1
,
1
]
,
pool_padding
=
[
0
,
0
]
,
pool_stride
=
None
,
pool_padding
=
None
,
global_pooling
=
False
,
main_program
=
None
,
startup_program
=
None
):
...
...
@@ -884,6 +886,10 @@ def pool2d(input,
This function adds the operator for pooling in 2 dimensions, using the
pooling configurations mentioned in input parameters.
"""
if
pool_padding
is
None
:
pool_padding
=
[
0
,
0
]
if
pool_stride
is
None
:
pool_stride
=
[
1
,
1
]
if
pool_type
not
in
[
"max"
,
"avg"
]:
raise
ValueError
(
"Unknown pool_type: '%s'. It can only be 'max' or 'avg'."
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录