@@ -1373,10 +1373,8 @@ def conv2d(input,
1373
1373
Examples:
1374
1374
.. code-block:: python
1375
1375
1376
- data = fluid.layers.data(
1377
- name='data', shape=[3, 32, 32], dtype='float32')
1378
- conv2d = fluid.layers.conv2d(
1379
- input=data, num_filters=2, filter_size=3, act="relu")
1376
+ data = fluid.layers.data(name='data', shape=[3, 32, 32], dtype='float32')
1377
+ conv2d = fluid.layers.conv2d(input=data, num_filters=2, filter_size=3, act="relu")
1380
1378
"""
1381
1379
1382
1380
num_channels = input .shape [1 ]
@@ -1478,8 +1476,7 @@ def conv3d(input,
1478
1476
* :math:`\\ ast`: Convolution operation.
1479
1477
* :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
1480
1478
* :math:`\\ sigma`: Activation function.
1481
- * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
1482
- different.
1479
+ * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
1483
1480
1484
1481
Example:
1485
1482
@@ -1541,10 +1538,8 @@ def conv3d(input,
1541
1538
Examples:
1542
1539
.. code-block:: python
1543
1540
1544
- data = fluid.layers.data(
1545
- name='data', shape=[3, 12, 32, 32], dtype='float32')
1546
- conv2d = fluid.layers.conv3d(
1547
- input=data, num_filters=2, filter_size=3, act="relu")
1541
+ data = fluid.layers.data(name='data', shape=[3, 12, 32, 32], dtype='float32')
1542
+ conv3d = fluid.layers.conv3d(input=data, num_filters=2, filter_size=3, act="relu")
1548
1543
"""
1549
1544
1550
1545
l_type = 'conv3d'
@@ -2182,32 +2177,36 @@ def conv2d_transpose(input,
2182
2177
represent height and width, respectively. The details of convolution transpose
2183
2178
layer, please refer to the following explanation and references
2184
2179
`therein <http://www.matthewzeiler.com/wp-content/uploads/2017/07/cvpr2010.pdf>`_.
2180
+ If bias attribution and activation type are provided, bias is added to
2181
+ the output of the convolution, and the corresponding activation function
2182
+ is applied to the final result.
2185
2183
2186
2184
For each input :math:`X`, the equation is:
2187
2185
2188
2186
.. math::
2189
2187
2190
- Out = W \\ ast X
2188
+ Out = \sigma ( W \\ ast X + b)
2191
2189
2192
- In the above equation :
2190
+ Where :
2193
2191
2194
2192
* :math:`X`: Input value, a tensor with NCHW format.
2195
2193
* :math:`W`: Filter value, a tensor with MCHW format.
2196
- * :math:`\\ ast` : Convolution transpose operation.
2197
- * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
2198
- different.
2194
+ * :math:`\\ ast`: Convolution operation.
2195
+ * :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
2196
+ * :math:`\\ sigma`: Activation function.
2197
+ * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
2199
2198
2200
2199
Example:
2201
2200
2202
2201
- Input:
2203
2202
2204
- Input shape: $ (N, C_{in}, H_{in}, W_{in})$
2203
+ Input shape: :math:` (N, C_{in}, H_{in}, W_{in})`
2205
2204
2206
- Filter shape: $ (C_{in}, C_{out}, H_f, W_f)$
2205
+ Filter shape: :math:` (C_{in}, C_{out}, H_f, W_f)`
2207
2206
2208
2207
- Output:
2209
2208
2210
- Output shape: $ (N, C_{out}, H_{out}, W_{out})$
2209
+ Output shape: :math:` (N, C_{out}, H_{out}, W_{out})`
2211
2210
2212
2211
Where
2213
2212
@@ -2261,10 +2260,8 @@ def conv2d_transpose(input,
2261
2260
Examples:
2262
2261
.. code-block:: python
2263
2262
2264
- data = fluid.layers.data(
2265
- name='data', shape=[3, 32, 32], dtype='float32')
2266
- conv2d_transpose = fluid.layers.conv2d_transpose(
2267
- input=data, num_filters=2, filter_size=3)
2263
+ data = fluid.layers.data(name='data', shape=[3, 32, 32], dtype='float32')
2264
+ conv2d_transpose = fluid.layers.conv2d_transpose(input=data, num_filters=2, filter_size=3)
2268
2265
"""
2269
2266
helper = LayerHelper ("conv2d_transpose" , ** locals ())
2270
2267
if not isinstance (input , Variable ):
@@ -2344,32 +2341,36 @@ def conv3d_transpose(input,
2344
2341
two elements. These two elements represent height and width, respectively.
2345
2342
The details of convolution transpose layer, please refer to the following
2346
2343
explanation and references `therein <http://www.matthewzeiler.com/wp-content/uploads/2017/07/cvpr2010.pdf>`_.
2344
+ If bias attribution and activation type are provided, bias is added to
2345
+ the output of the convolution, and the corresponding activation function
2346
+ is applied to the final result.
2347
2347
2348
2348
For each input :math:`X`, the equation is:
2349
2349
2350
2350
.. math::
2351
2351
2352
- Out = W \\ ast X
2352
+ Out = \sigma ( W \\ ast X + b)
2353
2353
2354
2354
In the above equation:
2355
2355
2356
2356
* :math:`X`: Input value, a tensor with NCDHW format.
2357
2357
* :math:`W`: Filter value, a tensor with MCDHW format.
2358
- * :math:`\\ ast` : Convolution transpose operation.
2359
- * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
2360
- different.
2358
+ * :math:`\\ ast`: Convolution operation.
2359
+ * :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
2360
+ * :math:`\\ sigma`: Activation function.
2361
+ * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
2361
2362
2362
2363
Example:
2363
2364
2364
2365
- Input:
2365
2366
2366
- Input shape: $ (N, C_{in}, D_{in}, H_{in}, W_{in})$
2367
+ Input shape: :math:` (N, C_{in}, D_{in}, H_{in}, W_{in})`
2367
2368
2368
- Filter shape: $ (C_{in}, C_{out}, D_f, H_f, W_f)$
2369
+ Filter shape: :math:` (C_{in}, C_{out}, D_f, H_f, W_f)`
2369
2370
2370
2371
- Output:
2371
2372
2372
- Output shape: $ (N, C_{out}, D_{out}, H_{out}, W_{out})$
2373
+ Output shape: :math:` (N, C_{out}, D_{out}, H_{out}, W_{out})`
2373
2374
2374
2375
Where
2375
2376
@@ -2424,10 +2425,8 @@ def conv3d_transpose(input,
2424
2425
Examples:
2425
2426
.. code-block:: python
2426
2427
2427
- data = fluid.layers.data(
2428
- name='data', shape=[3, 12, 32, 32], dtype='float32')
2429
- conv2d_transpose = fluid.layers.conv3d_transpose(
2430
- input=data, num_filters=2, filter_size=3)
2428
+ data = fluid.layers.data(name='data', shape=[3, 12, 32, 32], dtype='float32')
2429
+ conv3d_transpose = fluid.layers.conv3d_transpose(input=data, num_filters=2, filter_size=3)
2431
2430
"""
2432
2431
l_type = "conv3d_transpose"
2433
2432
helper = LayerHelper (l_type , ** locals ())
@@ -4778,17 +4777,18 @@ def mean_iou(input, label, num_classes):
4778
4777
IOU is defined as follows:
4779
4778
4780
4779
.. math::
4781
-
4782
- IOU = true_positive / (true_positive + false_positive + false_negative).
4780
+
4781
+ IOU = \\ frac{true\_positiv}{(true\_positive + false\_positive + false\_negative)}.
4783
4782
4784
4783
The predictions are accumulated in a confusion matrix and mean-IOU
4785
4784
is then calculated from it.
4786
4785
4787
4786
4788
4787
Args:
4789
4788
input (Variable): A Tensor of prediction results for semantic labels with type int32 or int64.
4790
- label (Variable): A Tensor of ground truth labels with type int32 or int64.
4789
+ label (Variable): A Tensor of ground truth labels with type int32 or int64.
4791
4790
Its shape should be the same as input.
4791
+ num_classes (int): The possible number of labels.
4792
4792
4793
4793
Returns:
4794
4794
mean_iou (Variable): A Tensor representing the mean intersection-over-union with shape [1].
0 commit comments