@@ -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'
@@ -2152,32 +2147,36 @@ def conv2d_transpose(input,
2152
2147
represent height and width, respectively. The details of convolution transpose
2153
2148
layer, please refer to the following explanation and references
2154
2149
`therein <http://www.matthewzeiler.com/wp-content/uploads/2017/07/cvpr2010.pdf>`_.
2150
+ If bias attribution and activation type are provided, bias is added to
2151
+ the output of the convolution, and the corresponding activation function
2152
+ is applied to the final result.
2155
2153
2156
2154
For each input :math:`X`, the equation is:
2157
2155
2158
2156
.. math::
2159
2157
2160
- Out = W \\ ast X
2158
+ Out = \sigma ( W \\ ast X + b)
2161
2159
2162
- In the above equation :
2160
+ Where :
2163
2161
2164
2162
* :math:`X`: Input value, a tensor with NCHW format.
2165
2163
* :math:`W`: Filter value, a tensor with MCHW format.
2166
- * :math:`\\ ast` : Convolution transpose operation.
2167
- * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
2168
- different.
2164
+ * :math:`\\ ast`: Convolution operation.
2165
+ * :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
2166
+ * :math:`\\ sigma`: Activation function.
2167
+ * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
2169
2168
2170
2169
Example:
2171
2170
2172
2171
- Input:
2173
2172
2174
- Input shape: $ (N, C_{in}, H_{in}, W_{in})$
2173
+ Input shape: :math:` (N, C_{in}, H_{in}, W_{in})`
2175
2174
2176
- Filter shape: $ (C_{in}, C_{out}, H_f, W_f)$
2175
+ Filter shape: :math:` (C_{in}, C_{out}, H_f, W_f)`
2177
2176
2178
2177
- Output:
2179
2178
2180
- Output shape: $ (N, C_{out}, H_{out}, W_{out})$
2179
+ Output shape: :math:` (N, C_{out}, H_{out}, W_{out})`
2181
2180
2182
2181
Where
2183
2182
@@ -2231,10 +2230,8 @@ def conv2d_transpose(input,
2231
2230
Examples:
2232
2231
.. code-block:: python
2233
2232
2234
- data = fluid.layers.data(
2235
- name='data', shape=[3, 32, 32], dtype='float32')
2236
- conv2d_transpose = fluid.layers.conv2d_transpose(
2237
- input=data, num_filters=2, filter_size=3)
2233
+ data = fluid.layers.data(name='data', shape=[3, 32, 32], dtype='float32')
2234
+ conv2d_transpose = fluid.layers.conv2d_transpose(input=data, num_filters=2, filter_size=3)
2238
2235
"""
2239
2236
helper = LayerHelper ("conv2d_transpose" , ** locals ())
2240
2237
if not isinstance (input , Variable ):
@@ -2314,32 +2311,36 @@ def conv3d_transpose(input,
2314
2311
two elements. These two elements represent height and width, respectively.
2315
2312
The details of convolution transpose layer, please refer to the following
2316
2313
explanation and references `therein <http://www.matthewzeiler.com/wp-content/uploads/2017/07/cvpr2010.pdf>`_.
2314
+ If bias attribution and activation type are provided, bias is added to
2315
+ the output of the convolution, and the corresponding activation function
2316
+ is applied to the final result.
2317
2317
2318
2318
For each input :math:`X`, the equation is:
2319
2319
2320
2320
.. math::
2321
2321
2322
- Out = W \\ ast X
2322
+ Out = \sigma ( W \\ ast X + b)
2323
2323
2324
2324
In the above equation:
2325
2325
2326
2326
* :math:`X`: Input value, a tensor with NCDHW format.
2327
2327
* :math:`W`: Filter value, a tensor with MCDHW format.
2328
- * :math:`\\ ast` : Convolution transpose operation.
2329
- * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
2330
- different.
2328
+ * :math:`\\ ast`: Convolution operation.
2329
+ * :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
2330
+ * :math:`\\ sigma`: Activation function.
2331
+ * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
2331
2332
2332
2333
Example:
2333
2334
2334
2335
- Input:
2335
2336
2336
- Input shape: $ (N, C_{in}, D_{in}, H_{in}, W_{in})$
2337
+ Input shape: :math:` (N, C_{in}, D_{in}, H_{in}, W_{in})`
2337
2338
2338
- Filter shape: $ (C_{in}, C_{out}, D_f, H_f, W_f)$
2339
+ Filter shape: :math:` (C_{in}, C_{out}, D_f, H_f, W_f)`
2339
2340
2340
2341
- Output:
2341
2342
2342
- Output shape: $ (N, C_{out}, D_{out}, H_{out}, W_{out})$
2343
+ Output shape: :math:` (N, C_{out}, D_{out}, H_{out}, W_{out})`
2343
2344
2344
2345
Where
2345
2346
@@ -2394,10 +2395,8 @@ def conv3d_transpose(input,
2394
2395
Examples:
2395
2396
.. code-block:: python
2396
2397
2397
- data = fluid.layers.data(
2398
- name='data', shape=[3, 12, 32, 32], dtype='float32')
2399
- conv2d_transpose = fluid.layers.conv3d_transpose(
2400
- input=data, num_filters=2, filter_size=3)
2398
+ data = fluid.layers.data(name='data', shape=[3, 12, 32, 32], dtype='float32')
2399
+ conv3d_transpose = fluid.layers.conv3d_transpose(input=data, num_filters=2, filter_size=3)
2401
2400
"""
2402
2401
l_type = "conv3d_transpose"
2403
2402
helper = LayerHelper (l_type , ** locals ())
@@ -4745,17 +4744,18 @@ def mean_iou(input, label, num_classes):
4745
4744
IOU is defined as follows:
4746
4745
4747
4746
.. math::
4748
-
4749
- IOU = true_positive / (true_positive + false_positive + false_negative).
4747
+
4748
+ IOU = \\ frac{true\_positiv}{(true\_positive + false\_positive + false\_negative)}.
4750
4749
4751
4750
The predictions are accumulated in a confusion matrix and mean-IOU
4752
4751
is then calculated from it.
4753
4752
4754
4753
4755
4754
Args:
4756
4755
input (Variable): A Tensor of prediction results for semantic labels with type int32 or int64.
4757
- label (Variable): A Tensor of ground truth labels with type int32 or int64.
4756
+ label (Variable): A Tensor of ground truth labels with type int32 or int64.
4758
4757
Its shape should be the same as input.
4758
+ num_classes (int): The possible number of labels.
4759
4759
4760
4760
Returns:
4761
4761
mean_iou (Variable): A Tensor representing the mean intersection-over-union with shape [1].
0 commit comments