@@ -1277,12 +1277,15 @@ def sequence_conv(input,
1277
1277
filter_size (int): the filter size (H and W).
1278
1278
filter_stride (int): stride of the filter.
1279
1279
padding (bool): if True, add paddings.
1280
- bias_attr (ParamAttr): The parameter attribute for the bias of this layer .
1280
+ bias_attr (ParamAttr|bool|None ): The parameter attribute for the bias of sequence_conv .
1281
1281
If it is set to False, no bias will be added to the output units.
1282
- If it is set to None, the bias is initialized zero. Default: None.
1282
+ If it is set to None or one attribute of ParamAttr, sequence_conv
1283
+ will create ParamAttr as bias_attr. If the Initializer of the bias_attr
1284
+ is not set, the bias is initialized zero. Default: None.
1283
1285
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
1284
- of this layer. If it is set to None, the parameter is initialized with
1285
- Xavier. Default: None.
1286
+ of sequence_conv. If it is set to None or one attribute of ParamAttr, sequence_conv
1287
+ will create ParamAttr as param_attr. If the Initializer of the param_attr
1288
+ is not set, the parameter is initialized with Xavier. Default: None.
1286
1289
act (str): the activation type
1287
1290
1288
1291
Returns:
@@ -1491,14 +1494,17 @@ def conv2d(input,
1491
1494
convolution in Alex Krizhevsky's Deep CNN paper: when group=2,
1492
1495
the first half of the filters is only connected to the first half
1493
1496
of the input channels, while the second half of the filters is only
1494
- connected to the second half of the input channels. Default: groups=1
1497
+ connected to the second half of the input channels. Default: groups=1.
1495
1498
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
1496
- of this layer. If it is set to None, the parameter is initialized with
1497
- :math:`Normal(0.0, std)`, and the :math:`std` is :math:`(\\ frac{2.0 }{filter\_elem\_num})^{0.5}`.
1498
- Default: None.
1499
- bias_attr (ParamAttr): The parameter attribute for the bias of this layer.
1499
+ of conv2d. If it is set to None or one attribute of ParamAttr, conv2d
1500
+ will create ParamAttr as param_attr. If the Initializer of the param_attr
1501
+ is not set, the parameter is initialized with :math:`Normal(0.0, std)`,
1502
+ and the :math:`std` is :math:`(\\ frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None.
1503
+ bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv2d.
1500
1504
If it is set to False, no bias will be added to the output units.
1501
- If it is set to None, the bias is initialized zero. Default: None.
1505
+ If it is set to None or one attribute of ParamAttr, conv2d
1506
+ will create ParamAttr as bias_attr. If the Initializer of the bias_attr
1507
+ is not set, the bias is initialized zero. Default: None.
1502
1508
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
1503
1509
library is installed. Default: True
1504
1510
act (str): Activation type, if it is set to None, activation is not appended.
@@ -1550,8 +1556,8 @@ def conv2d(input,
1550
1556
filter_shape = [num_filters , int (num_filter_channels )] + filter_size
1551
1557
1552
1558
def _get_default_param_initializer ():
1553
- filter_num_elem = filter_size [0 ] * filter_size [1 ] * num_channels
1554
- std = (2.0 / ( filter_num_elem ) )** 0.5
1559
+ filter_elem_num = filter_size [0 ] * filter_size [1 ] * num_channels
1560
+ std = (2.0 / filter_elem_num )** 0.5
1555
1561
return Normal (0.0 , std , 0 )
1556
1562
1557
1563
filter_param = helper .create_parameter (
@@ -1663,12 +1669,15 @@ def conv3d(input,
1663
1669
of the input channels, while the second half of the filters is only
1664
1670
connected to the second half of the input channels. Default: groups=1
1665
1671
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
1666
- of this layer. If it is set to None, the parameter is initialized with
1667
- :math:`Normal(0.0, std)`, and the :math:`std` is :math:`(\\ frac{2.0 }{filter\_elem\_num})^{0.5}`.
1668
- Default: None.
1669
- bias_attr (ParamAttr): The parameter attribute for the bias of this layer.
1672
+ of conv3d. If it is set to None or one attribute of ParamAttr, conv3d
1673
+ will create ParamAttr as param_attr. If it is set to None, the parameter
1674
+ is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is
1675
+ :math:`(\\ frac{2.0 }{filter\_elem\_num})^{0.5}`. Default: None.
1676
+ bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv3d.
1670
1677
If it is set to False, no bias will be added to the output units.
1671
- If it is set to None, the bias is initialized zero. Default: None.
1678
+ If it is set to None or one attribute of ParamAttr, conv3d
1679
+ will create ParamAttr as bias_attr. If the Initializer of the bias_attr
1680
+ is not set, the bias is initialized zero. Default: None.
1672
1681
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
1673
1682
library is installed. Default: True
1674
1683
act (str): Activation type, if it is set to None, activation is not appended.
@@ -2413,11 +2422,14 @@ def conv2d_transpose(input,
2413
2422
filters is only connected to the second half of the input channels.
2414
2423
Default: groups = 1.
2415
2424
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
2416
- of this layer. If it is set to None, the parameter is initialized with
2417
- Xavier. Default: None.
2418
- bias_attr (ParamAttr): The parameter attribute for the bias of this layer.
2425
+ of conv2d_transpose. If it is set to None or one attribute of ParamAttr, conv2d_transpose
2426
+ will create ParamAttr as param_attr. If the Initializer of the param_attr
2427
+ is not set, the parameter is initialized with Xavier. Default: None.
2428
+ bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv2d_transpose.
2419
2429
If it is set to False, no bias will be added to the output units.
2420
- If it is set to None, the bias is initialized zero. Default: None.
2430
+ If it is set to None or one attribute of ParamAttr, conv2d_transpose
2431
+ will create ParamAttr as bias_attr. If the Initializer of the bias_attr
2432
+ is not set, the bias is initialized zero. Default: None.
2421
2433
use_cudnn(bool): Use cudnn kernel or not, it is valid only when the cudnn
2422
2434
library is installed. Default: True.
2423
2435
act (str): Activation type, if it is set to None, activation is not appended.
@@ -2598,11 +2610,14 @@ def conv3d_transpose(input,
2598
2610
filters is only connected to the second half of the input channels.
2599
2611
Default: groups=1
2600
2612
param_attr (ParamAttr): The parameter attribute for learnable parameters/weights
2601
- of this layer. If it is set to None, the parameter is initialized with
2602
- Xavier. Default: None.
2603
- bias_attr (ParamAttr): The parameter attribute for the bias of this layer.
2613
+ of conv3d_transpose. If it is set to None or one attribute of ParamAttr, conv3d_transpose
2614
+ will create ParamAttr as param_attr. If the Initializer of the param_attr
2615
+ is not set, the parameter is initialized with Xavier. Default: None.
2616
+ bias_attr (ParamAttr|bool|None): The parameter attribute for the bias of conv3d_transpose.
2604
2617
If it is set to False, no bias will be added to the output units.
2605
- If it is set to None, the bias is initialized zero. Default: None.
2618
+ If it is set to None or one attribute of ParamAttr, conv3d_transpose
2619
+ will create ParamAttr as bias_attr. If the Initializer of the bias_attr
2620
+ is not set, the bias is initialized zero. Default: None.
2606
2621
use_cudnn(bool): Use cudnn kernel or not, it is valid only when the cudnn
2607
2622
library is installed. Default: True
2608
2623
act (str): Activation type, if it is set to None, activation is not appended.
0 commit comments