Skip to content

Commit f1fac48

Browse files
author
ranqiu
committed
Update annotations of layers.py
1 parent b49923b commit f1fac48

File tree

1 file changed

+44
-39
lines changed
  • python/paddle/trainer_config_helpers

1 file changed

+44
-39
lines changed

python/paddle/trainer_config_helpers/layers.py

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6548,26 +6548,27 @@ def switch_order_layer(input,
65486548
@layer_support()
65496549
def crop_layer(input, offset, axis=2, shape=None, name=None, layer_attr=None):
65506550
"""
6551-
This layer crops images by offset and shape. User can set crop shape by
6552-
args 'shape' explicitly or by reference input layer.
6551+
This layer crops images according to the offset and shape. Users can set
6552+
the crop shape through the argument 'shape' explicitly or by specifying a
6553+
reference input layer.
65536554
65546555
The example usage is:
65556556
65566557
.. code-block:: python
65576558
crop = crop_layer(input=[image_input, reference_input], axis=2, offset=[2, 3])
65586559
6559-
:param input: The input of this layer. If two inputs are given, the second input
6560-
will be regarded as reference input.
6560+
:param input: The input of this layer. If two inputs are given, the second one
6561+
will be regarded as the reference.
65616562
:type input: LayerOutput | Sequence
65626563
:param offset: The crop offset.
65636564
:type offset: Sequence
6564-
:param axis: start axis to be cropped. To image input layer:
6565+
:param axis: The start axis to be cropped. For image input layer:
65656566
- 0: batch size
65666567
- 1: channels
65676568
- 2: height
65686569
- 3: width
6569-
:type partial_sum: int
6570-
:param shape: The shape to be cropped. Default is None.
6570+
:type axis: int
6571+
:param shape: The shape to be cropped to. Default is None.
65716572
:type shape: Sequence | None
65726573
:param name: The name of this layer. It is optional.
65736574
:type name: basestring
@@ -6702,9 +6703,9 @@ def seq_slice_layer(input, starts, ends, name=None):
67026703
:type name: basestring
67036704
:param input: The input of this layer, which should be a sequence.
67046705
:type input: LayerOutput
6705-
:param starts: start indices to slice the input sequence.
6706+
:param starts: The start indices to slice the input sequence.
67066707
:type starts: LayerOutput | None
6707-
:param ends: end indices to slice the input sequence.
6708+
:param ends: The end indices to slice the input sequence.
67086709
:type ends: LayerOutput | None
67096710
:return: LayerOutput object.
67106711
:rtype: LayerOutput
@@ -6744,7 +6745,7 @@ def seq_slice_layer(input, starts, ends, name=None):
67446745
@layer_support()
67456746
def kmax_seq_score_layer(input, name=None, beam_size=1):
67466747
"""
6747-
This layer accepts one input which are scores over a sequence or a nested
6748+
This layer accepts one input which is scores over a sequence or a nested
67486749
sequence, and returns indices of beam_size sequences with highest scores.
67496750
67506751
.. code-block:: python
@@ -6754,11 +6755,11 @@ def kmax_seq_score_layer(input, name=None, beam_size=1):
67546755
67556756
:param name: The name of this layer. It is optional.
67566757
:type name: basestring
6757-
:param input: The input of this layer. It stores scores over a sequence or a nested
6758-
sequence and its size must be 1.
6758+
:param input: The input of this layer. It stores scores over a sequence or
6759+
a nested sequence and its size must be 1.
67596760
:type input: LayerOutput
6760-
:param beam_size: sequence indices with top beam_size scores are returned.
6761-
:type beam_size: double
6761+
:param beam_size: The indices of the sequences with top beam_size scores are returned.
6762+
:type beam_size: int
67626763
:return: LayerOutput object.
67636764
:rtype: LayerOutput
67646765
"""
@@ -6814,38 +6815,42 @@ def img_conv3d_layer(input,
68146815
:type name: basestring
68156816
:param input: The input of this layer.
68166817
:type input: LayerOutput
6817-
:param filter_size: The x dimension of a filter kernel. Or input a list.
6818+
:param filter_size: The dimensions of the filter kernel along three axises. If the parameter
6819+
is set to one integer, the three dimensions will be same.
68186820
:type filter_size: int | tuple | list
6819-
:param num_filters: Each filter group's number of filter
6821+
:param num_filters: The number of filters in each group.
6822+
:type num_filters: int
68206823
:param act: Activation type. ReluActivation is the default.
68216824
:type act: BaseActivation
6822-
:param groups: Group size of filters.
6825+
:param groups: The number of the filter groups.
68236826
:type groups: int
6824-
:param stride: The x dimension of the stride. Or input a tuple for two image
6825-
dimension.
6827+
:param stride: The strides of the convolution along three axises. If the parameter
6828+
is set to one integer, the three strides will be same.
68266829
:type stride: int | tuple | list
6827-
:param padding: The x dimension of the padding. Or input a tuple for two
6828-
image dimension
6830+
:param padding: The numbers of padding along three axises. If the parameter is set to
6831+
one integer, they will be same.
68296832
:type padding: int | tuple | list
6830-
:param bias_attr: Convolution bias attribute. None means default bias.
6831-
False means no bias.
6833+
:param bias_attr: The Bias Attribute. If the parameter is set to
6834+
False or something not type of ParameterAttribute,
6835+
no bias is defined. If the parameter is set to
6836+
True, the bias is initialized to zero.
68326837
:type bias_attr: ParameterAttribute | None | bool | Any
6833-
:param num_channels: number of input channels. If None will be set
6834-
automatically from previous output.
6838+
:param num_channels: The number of input channels. If the parameter is not set or
6839+
set to None, its actual value will be automatically set to
6840+
the channels number of the input .
68356841
:type num_channels: int
6836-
:param param_attr: Convolution param attribute. None means default attribute
6842+
:param param_attr: The parameter attribute of the convolution.
68376843
:type param_attr: ParameterAttribute
6838-
:param shared_biases: Is biases will be shared between filters or not.
6844+
:param shared_biases: Whether biases will be shared between filters or not.
68396845
:type shared_biases: bool
6840-
:param layer_attr: Layer Extra Attribute.
6846+
:param layer_attr: Extra layer attributes.
68416847
:type layer_attr: ExtraLayerAttribute
6842-
:param trans: true if it is a convTransLayer, false if it is a convLayer
6848+
:param trans: True if it is a convTransLayer, False if it is a convLayer
68436849
:type trans: bool
6844-
:param layer_type: specify the layer_type, default is None. If trans=True,
6845-
layer_type has to be "exconvt" or "cudnn_convt",
6846-
otherwise layer_type has to be either "exconv" or
6847-
"cudnn_conv"
6848-
:type layer_type: String
6850+
:param layer_type: Specify the layer_type. If the parameter is set, it must be "deconv3d"
6851+
when trans=True. If not set, it will be automatically set to "deconv3d"
6852+
when trans=True and "conv3d" when trans=False.
6853+
:type layer_type: basestring
68496854
:return: LayerOutput object.
68506855
:rtype: LayerOutput
68516856
"""
@@ -6927,7 +6932,7 @@ def img_conv3d_layer(input,
69276932
def scale_shift_layer(input, name=None, param_attr=None, bias_attr=None):
69286933
"""
69296934
A layer applies a linear transformation to each element in each row of
6930-
the input matrix. For each element, the layer first re-scale it and then
6935+
the input matrix. For each element, the layer first re-scales it and then
69316936
adds a bias to it.
69326937
69336938
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):
70017006
:type name: basestring
70027007
:param input: The input of this layer, which should be sequence.
70037008
:type input: LayerOutput
7004-
:param offsets: offset indices to slice the input sequence, which should be
7005-
sequence type.
7009+
:param offsets: The offset indices to slice the input sequence, which should
7010+
be sequence type.
70067011
:type offsets: LayerOutput
7007-
:param sizes: sizes of the sub-sequences, which should be sequence type.
7012+
:param sizes: The sizes of the sub-sequences, which should be sequence type.
70087013
:type sizes: LayerOutput
7009-
:param act: Layer activation, default is LinearActivation
7014+
:param act: Activation type, LinearActivation is the default.
70107015
:type act: BaseActivation.
70117016
:param bias_attr: The Bias Attribute. If the parameter is set to
70127017
False or something not type of ParameterAttribute,

0 commit comments

Comments
 (0)