Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
fcc50cb4
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
fcc50cb4
编写于
11月 08, 2017
作者:
C
Cao Ying
提交者:
GitHub
11月 08, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5437 from ranqiu92/doc
Update annotations of layers.py.
上级
f72729d4
f1fac487
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
44 addition
and
39 deletion
+44
-39
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+44
-39
未找到文件。
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
fcc50cb4
...
@@ -6548,26 +6548,27 @@ def switch_order_layer(input,
...
@@ -6548,26 +6548,27 @@ def switch_order_layer(input,
@
layer_support
()
@
layer_support
()
def
crop_layer
(
input
,
offset
,
axis
=
2
,
shape
=
None
,
name
=
None
,
layer_attr
=
None
):
def
crop_layer
(
input
,
offset
,
axis
=
2
,
shape
=
None
,
name
=
None
,
layer_attr
=
None
):
"""
"""
This layer crops images by offset and shape. User can set crop shape by
This layer crops images according to the offset and shape. Users can set
args 'shape' explicitly or by reference input layer.
the crop shape through the argument 'shape' explicitly or by specifying a
reference input layer.
The example usage is:
The example usage is:
.. code-block:: python
.. code-block:: python
crop = crop_layer(input=[image_input, reference_input], axis=2, offset=[2, 3])
crop = crop_layer(input=[image_input, reference_input], axis=2, offset=[2, 3])
:param input: The input of this layer. If two inputs are given, the second
input
:param input: The input of this layer. If two inputs are given, the second
one
will be regarded as
reference input
.
will be regarded as
the reference
.
:type input: LayerOutput | Sequence
:type input: LayerOutput | Sequence
:param offset: The crop offset.
:param offset: The crop offset.
:type offset: Sequence
:type offset: Sequence
:param axis:
start axis to be cropped. To
image input layer:
:param axis:
The start axis to be cropped. For
image input layer:
- 0: batch size
- 0: batch size
- 1: channels
- 1: channels
- 2: height
- 2: height
- 3: width
- 3: width
:type
partial_sum
: int
:type
axis
: int
:param shape: The shape to be cropped. Default is None.
:param shape: The shape to be cropped
to
. Default is None.
:type shape: Sequence | None
:type shape: Sequence | None
:param name: The name of this layer. It is optional.
:param name: The name of this layer. It is optional.
:type name: basestring
:type name: basestring
...
@@ -6702,9 +6703,9 @@ def seq_slice_layer(input, starts, ends, name=None):
...
@@ -6702,9 +6703,9 @@ def seq_slice_layer(input, starts, ends, name=None):
:type name: basestring
:type name: basestring
:param input: The input of this layer, which should be a sequence.
:param input: The input of this layer, which should be a sequence.
:type input: LayerOutput
:type input: LayerOutput
:param starts: start indices to slice the input sequence.
:param starts:
The
start indices to slice the input sequence.
:type starts: LayerOutput | None
:type starts: LayerOutput | None
:param ends: end indices to slice the input sequence.
:param ends:
The
end indices to slice the input sequence.
:type ends: LayerOutput | None
:type ends: LayerOutput | None
:return: LayerOutput object.
:return: LayerOutput object.
:rtype: LayerOutput
:rtype: LayerOutput
...
@@ -6744,7 +6745,7 @@ def seq_slice_layer(input, starts, ends, name=None):
...
@@ -6744,7 +6745,7 @@ def seq_slice_layer(input, starts, ends, name=None):
@
layer_support
()
@
layer_support
()
def
kmax_seq_score_layer
(
input
,
name
=
None
,
beam_size
=
1
):
def
kmax_seq_score_layer
(
input
,
name
=
None
,
beam_size
=
1
):
"""
"""
This layer accepts one input which
are
scores over a sequence or a nested
This layer accepts one input which
is
scores over a sequence or a nested
sequence, and returns indices of beam_size sequences with highest scores.
sequence, and returns indices of beam_size sequences with highest scores.
.. code-block:: python
.. code-block:: python
...
@@ -6754,11 +6755,11 @@ def kmax_seq_score_layer(input, name=None, beam_size=1):
...
@@ -6754,11 +6755,11 @@ def kmax_seq_score_layer(input, name=None, beam_size=1):
:param name: The name of this layer. It is optional.
:param name: The name of this layer. It is optional.
:type name: basestring
:type name: basestring
:param input: The input of this layer. It stores scores over a sequence or
a nested
:param input: The input of this layer. It stores scores over a sequence or
sequence and its size must be 1.
a nested
sequence and its size must be 1.
:type input: LayerOutput
:type input: LayerOutput
:param beam_size:
sequence indi
ces with top beam_size scores are returned.
:param beam_size:
The indices of the sequen
ces with top beam_size scores are returned.
:type beam_size:
double
:type beam_size:
int
:return: LayerOutput object.
:return: LayerOutput object.
:rtype: LayerOutput
:rtype: LayerOutput
"""
"""
...
@@ -6814,38 +6815,42 @@ def img_conv3d_layer(input,
...
@@ -6814,38 +6815,42 @@ def img_conv3d_layer(input,
:type name: basestring
:type name: basestring
:param input: The input of this layer.
:param input: The input of this layer.
:type input: LayerOutput
:type input: LayerOutput
:param filter_size: The x dimension of a filter kernel. Or input a list.
:param filter_size: The dimensions of the filter kernel along three axises. If the parameter
is set to one integer, the three dimensions will be same.
:type filter_size: int | tuple | list
:type filter_size: int | tuple | list
:param num_filters: Each filter group's number of filter
:param num_filters: The number of filters in each group.
:type num_filters: int
:param act: Activation type. ReluActivation is the default.
:param act: Activation type. ReluActivation is the default.
:type act: BaseActivation
:type act: BaseActivation
:param groups:
Group size of filter
s.
:param groups:
The number of the filter group
s.
:type groups: int
:type groups: int
:param stride: The
x dimension of the stride. Or input a tuple for two image
:param stride: The
strides of the convolution along three axises. If the parameter
dimension
.
is set to one integer, the three strides will be same
.
:type stride: int | tuple | list
:type stride: int | tuple | list
:param padding: The
x dimension of the padding. Or input a tuple for tw
o
:param padding: The
numbers of padding along three axises. If the parameter is set t
o
image dimension
one integer, they will be same.
:type padding: int | tuple | list
:type padding: int | tuple | list
:param bias_attr: Convolution bias attribute. None means default bias.
:param bias_attr: The Bias Attribute. If the parameter is set to
False means no bias.
False or something not type of ParameterAttribute,
no bias is defined. If the parameter is set to
True, the bias is initialized to zero.
:type bias_attr: ParameterAttribute | None | bool | Any
:type bias_attr: ParameterAttribute | None | bool | Any
:param num_channels: number of input channels. If None will be set
:param num_channels: The number of input channels. If the parameter is not set or
automatically from previous output.
set to None, its actual value will be automatically set to
the channels number of the input .
:type num_channels: int
:type num_channels: int
:param param_attr:
Convolution param attribute. None means default attribute
:param param_attr:
The parameter attribute of the convolution.
:type param_attr: ParameterAttribute
:type param_attr: ParameterAttribute
:param shared_biases:
Is
biases will be shared between filters or not.
:param shared_biases:
Whether
biases will be shared between filters or not.
:type shared_biases: bool
:type shared_biases: bool
:param layer_attr:
Layer Extra Attribute
.
:param layer_attr:
Extra layer attributes
.
:type layer_attr: ExtraLayerAttribute
:type layer_attr: ExtraLayerAttribute
:param trans:
true if it is a convTransLayer, f
alse if it is a convLayer
:param trans:
True if it is a convTransLayer, F
alse if it is a convLayer
:type trans: bool
:type trans: bool
:param layer_type: specify the layer_type, default is None. If trans=True,
:param layer_type: Specify the layer_type. If the parameter is set, it must be "deconv3d"
layer_type has to be "exconvt" or "cudnn_convt",
when trans=True. If not set, it will be automatically set to "deconv3d"
otherwise layer_type has to be either "exconv" or
when trans=True and "conv3d" when trans=False.
"cudnn_conv"
:type layer_type: basestring
:type layer_type: String
:return: LayerOutput object.
:return: LayerOutput object.
:rtype: LayerOutput
:rtype: LayerOutput
"""
"""
...
@@ -6927,7 +6932,7 @@ def img_conv3d_layer(input,
...
@@ -6927,7 +6932,7 @@ def img_conv3d_layer(input,
def
scale_shift_layer
(
input
,
name
=
None
,
param_attr
=
None
,
bias_attr
=
None
):
def
scale_shift_layer
(
input
,
name
=
None
,
param_attr
=
None
,
bias_attr
=
None
):
"""
"""
A layer applies a linear transformation to each element in each row of
A layer applies a linear transformation to each element in each row of
the input matrix. For each element, the layer first re-scale it and then
the input matrix. For each element, the layer first re-scale
s
it and then
adds a bias to it.
adds a bias to it.
This layer is very like the SlopeInterceptLayer, except the scale and
This layer is very like the SlopeInterceptLayer, except the scale and
...
@@ -7001,12 +7006,12 @@ def sub_seq_layer(input, offsets, sizes, act=None, bias_attr=None, name=None):
...
@@ -7001,12 +7006,12 @@ def sub_seq_layer(input, offsets, sizes, act=None, bias_attr=None, name=None):
:type name: basestring
:type name: basestring
:param input: The input of this layer, which should be sequence.
:param input: The input of this layer, which should be sequence.
:type input: LayerOutput
:type input: LayerOutput
:param offsets:
offset indices to slice the input sequence, which should be
:param offsets:
The offset indices to slice the input sequence, which should
sequence type.
be
sequence type.
:type offsets: LayerOutput
:type offsets: LayerOutput
:param sizes: sizes of the sub-sequences, which should be sequence type.
:param sizes:
The
sizes of the sub-sequences, which should be sequence type.
:type sizes: LayerOutput
:type sizes: LayerOutput
:param act:
Layer activation, default is LinearActivation
:param act:
Activation type, LinearActivation is the default.
:type act: BaseActivation.
:type act: BaseActivation.
:param bias_attr: The Bias Attribute. If the parameter is set to
:param bias_attr: The Bias Attribute. If the parameter is set to
False or something not type of ParameterAttribute,
False or something not type of ParameterAttribute,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录