@@ -1326,10 +1326,8 @@ def conv2d(input,
1326
1326
Examples:
1327
1327
.. code-block:: python
1328
1328
1329
- data = fluid.layers.data(
1330
- name='data', shape=[3, 32, 32], dtype='float32')
1331
- conv2d = fluid.layers.conv2d(
1332
- input=data, num_filters=2, filter_size=3, act="relu")
1329
+ data = fluid.layers.data(name='data', shape=[3, 32, 32], dtype='float32')
1330
+ conv2d = fluid.layers.conv2d(input=data, num_filters=2, filter_size=3, act="relu")
1333
1331
"""
1334
1332
1335
1333
num_channels = input .shape [1 ]
@@ -1431,8 +1429,7 @@ def conv3d(input,
1431
1429
* :math:`\\ ast`: Convolution operation.
1432
1430
* :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
1433
1431
* :math:`\\ sigma`: Activation function.
1434
- * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
1435
- different.
1432
+ * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
1436
1433
1437
1434
Example:
1438
1435
@@ -1494,10 +1491,8 @@ def conv3d(input,
1494
1491
Examples:
1495
1492
.. code-block:: python
1496
1493
1497
- data = fluid.layers.data(
1498
- name='data', shape=[3, 12, 32, 32], dtype='float32')
1499
- conv2d = fluid.layers.conv3d(
1500
- input=data, num_filters=2, filter_size=3, act="relu")
1494
+ data = fluid.layers.data(name='data', shape=[3, 12, 32, 32], dtype='float32')
1495
+ conv3d = fluid.layers.conv3d(input=data, num_filters=2, filter_size=3, act="relu")
1501
1496
"""
1502
1497
1503
1498
l_type = 'conv3d'
@@ -2105,32 +2100,36 @@ def conv2d_transpose(input,
2105
2100
represent height and width, respectively. The details of convolution transpose
2106
2101
layer, please refer to the following explanation and references
2107
2102
`therein <http://www.matthewzeiler.com/wp-content/uploads/2017/07/cvpr2010.pdf>`_.
2103
+ If bias attribution and activation type are provided, bias is added to
2104
+ the output of the convolution, and the corresponding activation function
2105
+ is applied to the final result.
2108
2106
2109
2107
For each input :math:`X`, the equation is:
2110
2108
2111
2109
.. math::
2112
2110
2113
- Out = W \\ ast X
2111
+ Out = \sigma ( W \\ ast X + b)
2114
2112
2115
- In the above equation :
2113
+ Where :
2116
2114
2117
2115
* :math:`X`: Input value, a tensor with NCHW format.
2118
2116
* :math:`W`: Filter value, a tensor with MCHW format.
2119
- * :math:`\\ ast` : Convolution transpose operation.
2120
- * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
2121
- different.
2117
+ * :math:`\\ ast`: Convolution operation.
2118
+ * :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
2119
+ * :math:`\\ sigma`: Activation function.
2120
+ * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
2122
2121
2123
2122
Example:
2124
2123
2125
2124
- Input:
2126
2125
2127
- Input shape: $ (N, C_{in}, H_{in}, W_{in})$
2126
+ Input shape: :math:` (N, C_{in}, H_{in}, W_{in})`
2128
2127
2129
- Filter shape: $ (C_{in}, C_{out}, H_f, W_f)$
2128
+ Filter shape: :math:` (C_{in}, C_{out}, H_f, W_f)`
2130
2129
2131
2130
- Output:
2132
2131
2133
- Output shape: $ (N, C_{out}, H_{out}, W_{out})$
2132
+ Output shape: :math:` (N, C_{out}, H_{out}, W_{out})`
2134
2133
2135
2134
Where
2136
2135
@@ -2184,10 +2183,8 @@ def conv2d_transpose(input,
2184
2183
Examples:
2185
2184
.. code-block:: python
2186
2185
2187
- data = fluid.layers.data(
2188
- name='data', shape=[3, 32, 32], dtype='float32')
2189
- conv2d_transpose = fluid.layers.conv2d_transpose(
2190
- input=data, num_filters=2, filter_size=3)
2186
+ data = fluid.layers.data(name='data', shape=[3, 32, 32], dtype='float32')
2187
+ conv2d_transpose = fluid.layers.conv2d_transpose(input=data, num_filters=2, filter_size=3)
2191
2188
"""
2192
2189
helper = LayerHelper ("conv2d_transpose" , ** locals ())
2193
2190
if not isinstance (input , Variable ):
@@ -2267,32 +2264,36 @@ def conv3d_transpose(input,
2267
2264
two elements. These two elements represent height and width, respectively.
2268
2265
The details of convolution transpose layer, please refer to the following
2269
2266
explanation and references `therein <http://www.matthewzeiler.com/wp-content/uploads/2017/07/cvpr2010.pdf>`_.
2267
+ If bias attribution and activation type are provided, bias is added to
2268
+ the output of the convolution, and the corresponding activation function
2269
+ is applied to the final result.
2270
2270
2271
2271
For each input :math:`X`, the equation is:
2272
2272
2273
2273
.. math::
2274
2274
2275
- Out = W \\ ast X
2275
+ Out = \sigma ( W \\ ast X + b)
2276
2276
2277
2277
In the above equation:
2278
2278
2279
2279
* :math:`X`: Input value, a tensor with NCDHW format.
2280
2280
* :math:`W`: Filter value, a tensor with MCDHW format.
2281
- * :math:`\\ ast` : Convolution transpose operation.
2282
- * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
2283
- different.
2281
+ * :math:`\\ ast`: Convolution operation.
2282
+ * :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
2283
+ * :math:`\\ sigma`: Activation function.
2284
+ * :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
2284
2285
2285
2286
Example:
2286
2287
2287
2288
- Input:
2288
2289
2289
- Input shape: $ (N, C_{in}, D_{in}, H_{in}, W_{in})$
2290
+ Input shape: :math:` (N, C_{in}, D_{in}, H_{in}, W_{in})`
2290
2291
2291
- Filter shape: $ (C_{in}, C_{out}, D_f, H_f, W_f)$
2292
+ Filter shape: :math:` (C_{in}, C_{out}, D_f, H_f, W_f)`
2292
2293
2293
2294
- Output:
2294
2295
2295
- Output shape: $ (N, C_{out}, D_{out}, H_{out}, W_{out})$
2296
+ Output shape: :math:` (N, C_{out}, D_{out}, H_{out}, W_{out})`
2296
2297
2297
2298
Where
2298
2299
@@ -2347,10 +2348,8 @@ def conv3d_transpose(input,
2347
2348
Examples:
2348
2349
.. code-block:: python
2349
2350
2350
- data = fluid.layers.data(
2351
- name='data', shape=[3, 12, 32, 32], dtype='float32')
2352
- conv2d_transpose = fluid.layers.conv3d_transpose(
2353
- input=data, num_filters=2, filter_size=3)
2351
+ data = fluid.layers.data(name='data', shape=[3, 12, 32, 32], dtype='float32')
2352
+ conv3d_transpose = fluid.layers.conv3d_transpose(input=data, num_filters=2, filter_size=3)
2354
2353
"""
2355
2354
l_type = "conv3d_transpose"
2356
2355
helper = LayerHelper (l_type , ** locals ())
@@ -4680,17 +4679,18 @@ def mean_iou(input, label, num_classes):
4680
4679
IOU is defined as follows:
4681
4680
4682
4681
.. math::
4683
-
4684
- IOU = true_positive / (true_positive + false_positive + false_negative).
4682
+
4683
+ IOU = \\ frac{true\_positiv}{(true\_positive + false\_positive + false\_negative)}.
4685
4684
4686
4685
The predictions are accumulated in a confusion matrix and mean-IOU
4687
4686
is then calculated from it.
4688
4687
4689
4688
4690
4689
Args:
4691
4690
input (Variable): A Tensor of prediction results for semantic labels with type int32 or int64.
4692
- label (Variable): A Tensor of ground truth labels with type int32 or int64.
4691
+ label (Variable): A Tensor of ground truth labels with type int32 or int64.
4693
4692
Its shape should be the same as input.
4693
+ num_classes (int): The possible number of labels.
4694
4694
4695
4695
Returns:
4696
4696
mean_iou (Variable): A Tensor representing the mean intersection-over-union with shape [1].
0 commit comments