Skip to content

Commit acdb57a

Browse files
committed
polish doc: conv2d
1 parent d516ace commit acdb57a

File tree

1 file changed

+15
-11
lines changed
  • python/paddle/fluid/layers

1 file changed

+15
-11
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,14 +1183,17 @@ def conv2d(input,
11831183
act=None,
11841184
name=None):
11851185
"""
1186-
**Convlution2D Layer**
1187-
11881186
The convolution2D layer calculates the output based on the input, filter
1189-
and strides, paddings, dilations, groups parameters. Input(Input) and
1190-
Output(Output) are in NCHW format. Where N is batch size, C is the number of
1187+
and strides, paddings, dilations, groups parameters. Input and
1188+
Output are in NCHW format, where N is batch size, C is the number of
11911189
channels, H is the height of the feature, and W is the width of the feature.
1192-
The details of convolution layer, please refer UFLDL's `convolution,
1193-
<http://ufldl.stanford.edu/tutorial/supervised/FeatureExtractionUsingConvolution/>`_ .
1190+
Filter is in MCHW format, where M is the number of output image channels,
1191+
C is the number of input image channels, H is the height of the filter,
1192+
and W is the width of the filter. If the groups is greater than 1,
1193+
C will equal the number of input image channels divided by the groups.
1194+
Please refer to UFLDL's `convolution
1195+
<http://ufldl.stanford.edu/tutorial/supervised/FeatureExtractionUsingConvolution/>`_
1196+
for more detials.
11941197
If bias attribution and activation type are provided, bias is added to the
11951198
output of the convolution, and the corresponding activation function is
11961199
applied to the final result.
@@ -1201,15 +1204,14 @@ def conv2d(input,
12011204
12021205
Out = \sigma (W \\ast X + b)
12031206
1204-
In the above equation:
1207+
Where:
12051208
12061209
* :math:`X`: Input value, a tensor with NCHW format.
12071210
* :math:`W`: Filter value, a tensor with MCHW format.
12081211
* :math:`\\ast`: Convolution operation.
12091212
* :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
12101213
* :math:`\\sigma`: Activation function.
1211-
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
1212-
different.
1214+
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
12131215
12141216
Example:
12151217
@@ -1220,6 +1222,7 @@ def conv2d(input,
12201222
Filter shape: :math:`(C_{out}, C_{in}, H_f, W_f)`
12211223
12221224
- Output:
1225+
12231226
Output shape: :math:`(N, C_{out}, H_{out}, W_{out})`
12241227
12251228
Where
@@ -1231,7 +1234,7 @@ def conv2d(input,
12311234
12321235
Args:
12331236
input (Variable): The input image with [N, C, H, W] format.
1234-
num_filters(int): The number of filter. It is as same as the output
1237+
num_filters(int): The number of filter. It is as same as the output
12351238
image channel.
12361239
filter_size (int|tuple|None): The filter size. If filter_size is a tuple,
12371240
it must contain two integers, (filter_size_H, filter_size_W).
@@ -1254,7 +1257,8 @@ def conv2d(input,
12541257
bias_attr (ParamAttr): Bias parameter for the Conv2d layer. Default: None
12551258
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
12561259
library is installed. Default: True
1257-
use_mkldnn (bool): Use mkldnn kernels or not.
1260+
use_mkldnn (bool): Use mkldnn kernels or not, it is valid only when compiled
1261+
with mkldnn library. Default: False
12581262
act (str): Activation type. Default: None
12591263
name (str|None): A name for this layer(optional). If set None, the layer
12601264
will be named automatically.

0 commit comments

Comments
 (0)