Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
d43fbbae
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d43fbbae
编写于
7月 18, 2017
作者:
X
xzl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add comments for python api
上级
11588b36
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
67 addition
and
1 deletion
+67
-1
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+67
-1
未找到文件。
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
d43fbbae
...
@@ -2269,7 +2269,6 @@ def img_depthwise_conv_layer(input,
...
@@ -2269,7 +2269,6 @@ def img_depthwise_conv_layer(input,
name
=
None
,
name
=
None
,
num_channels
=
None
,
num_channels
=
None
,
act
=
None
,
act
=
None
,
groups
=
None
,
stride
=
1
,
stride
=
1
,
padding
=
0
,
padding
=
0
,
bias_attr
=
None
,
bias_attr
=
None
,
...
@@ -2281,11 +2280,78 @@ def img_depthwise_conv_layer(input,
...
@@ -2281,11 +2280,78 @@ def img_depthwise_conv_layer(input,
padding_y
=
None
,
padding_y
=
None
,
trans
=
False
,
trans
=
False
,
layer_type
=
None
):
layer_type
=
None
):
"""
DepthwiseConvolution layer for image.
The details of depthwise convolution layer, please refer
https://arxiv.org/abs/1704.04861
The Depthwise Convolution layer must meet this requirement that the groups equals to the
inputChannels. And the groups must be divisible by outputChannels.
So the filter shape will be (groups, outputChannels/groups, 1, filter_size, filter_size_y)
The example usage is:
.. code-block:: python
conv = img_depthwise_conv_layer(input=data, filter_size=1, filter_size_y=1,
num_channels=8,
num_filters=16, stride=1,
bias_attr=False,
act=ReluActivation())
:param name: Layer name.
:type name: basestring
:param input: Layer Input.
:type input: LayerOutput
:param filter_size: The x dimension of a filter kernel. Or input a tuple for
two image dimension.
:type filter_size: int|tuple|list
:param filter_size_y: The y dimension of a filter kernel. Since PaddlePaddle
currently supports rectangular filters, the filter's
shape will be (filter_size, filter_size_y).
:type filter_size_y: int|None
:param num_filters: Each filter group's number of filter
:param act: Activation type. Default is tanh
:type act: BaseActivation
:param stride: The x dimension of the stride. Or input a tuple for two image
dimension.
:type stride: int|tuple|list
:param stride_y: The y dimension of the stride.
:type stride_y: int
:param padding: The x dimension of the padding. Or input a tuple for two
image dimension
:type padding: int|tuple|list
:param padding_y: The y dimension of the padding.
:type padding_y: int
:param bias_attr: DepthwiseConvolution bias attribute. None means default bias.
False means no bias.
:type bias_attr: ParameterAttribute|False
:param num_channels: number of input channels. If None will be set
automatically from previous output.
:type num_channels: int
:param param_attr: DepthwiseConvolution param attribute. None means default attribute
:type param_attr: ParameterAttribute
:param shared_biases: Is biases will be shared between filters or not.
:type shared_biases: bool
:param layer_attr: Layer Extra Attribute.
:type layer_attr: ExtraLayerAttribute
:param trans: true if it is a convTransLayer, false if it is a convLayer
:type trans: bool
:param layer_type: specify the layer_type, default is None. If trans=True,
layer_type has to be "exconvt" or "cudnn_convt",
otherwise layer_type has to be either "exconv" or
"cudnn_conv"
:type layer_type: String
:return: LayerOutput object.
:rtype: LayerOutput
"""
if
num_channels
is
None
:
if
num_channels
is
None
:
assert
input
.
num_filters
is
not
None
assert
input
.
num_filters
is
not
None
num_channels
=
input
.
num_filters
num_channels
=
input
.
num_filters
# the groups in depthwise conv should be equal to input channels.
groups
=
num_channels
groups
=
num_channels
if
filter_size_y
is
None
:
if
filter_size_y
is
None
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录