@@ -2458,12 +2458,12 @@ def img_conv_layer(input,
2458
2458
input is raw pixels of image(mono or RGB), or it may be the previous layer's
2459
2459
num_filters * num_group.
2460
2460
2461
- There are several group of filter in PaddlePaddle implementation.
2462
- Each group will process some channel of the inputs . For example, if an input
2461
+ There are several groups of filters in PaddlePaddle implementation.
2462
+ Each group will process some channels of the input . For example, if
2463
2463
num_channel = 256, group = 4, num_filter=32, the PaddlePaddle will create
2464
- 32*4 = 128 filters to process inputs . The channels will be split into 4
2465
- pieces. First 256/4 = 64 channels will process by first 32 filters. The
2466
- rest channels will be processed by rest group of filters.
2464
+ 32*4 = 128 filters to process the input . The channels will be split into 4
2465
+ pieces. First 256/4 = 64 channels will be processed by first 32 filters. The
2466
+ rest channels will be processed by the rest groups of filters.
2467
2467
2468
2468
The example usage is:
2469
2469
@@ -2479,53 +2479,68 @@ def img_conv_layer(input,
2479
2479
:type name: basestring
2480
2480
:param input: The input of this layer.
2481
2481
:type input: LayerOutput
2482
- :param filter_size: The x dimension of a filter kernel. Or input a tuple for
2483
- two image dimension.
2482
+ :param filter_size: The dimensions of the filter kernel. If the parameter is
2483
+ set to one integer, the two dimensions on x and y axises
2484
+ will be same when filter_size_y is not set. If it is set
2485
+ to a list, the first element indicates the dimension on
2486
+ the x axis, and the second is used to specify the dimension
2487
+ on the y axis when filter_size_y is not provided.
2484
2488
:type filter_size: int | tuple | list
2485
- :param filter_size_y: The y dimension of a filter kernel. Since PaddlePaddle
2486
- currently supports rectangular filters, the filter's
2487
- shape will be (filter_size, filter_size_y).
2488
- :type filter_size_y: int | None
2489
+ :param filter_size_y: The dimension of the filter kernel on the y axis. If the parameter
2490
+ is not set, it will be set automatically according to filter_size.
2491
+ :type filter_size_y: int
2489
2492
:param num_filters: Each filter group's number of filter
2490
2493
:param act: Activation type. ReluActivation is the default activation.
2491
2494
:type act: BaseActivation
2492
- :param groups: Group size of filters .
2495
+ :param groups: The group number. 1 is the default group number .
2493
2496
:type groups: int
2494
- :param stride: The x dimension of the stride. Or input a tuple for two image
2495
- dimension.
2497
+ :param stride: The strides. If the parameter is set to one integer, the strides
2498
+ on x and y axises will be same when stride_y is not set. If it is
2499
+ set to a list, the first element indicates the stride on the x axis,
2500
+ and the second is used to specify the stride on the y axis when
2501
+ stride_y is not provided. 1 is the default value.
2496
2502
:type stride: int | tuple | list
2497
- :param stride_y: The y dimension of the stride .
2503
+ :param stride_y: The stride on the y axis .
2498
2504
:type stride_y: int
2499
- :param padding: The x dimension of the padding. Or input a tuple for two
2500
- image dimension
2505
+ :param padding: The padding sizes. If the parameter is set to one integer, the padding
2506
+ sizes on x and y axises will be same when padding_y is not set. If it
2507
+ is set to a list, the first element indicates the padding size on the
2508
+ x axis, and the second is used to specify the padding size on the y axis
2509
+ when padding_y is not provided. 0 is the default padding size.
2501
2510
:type padding: int | tuple | list
2502
- :param padding_y: The y dimension of the padding .
2511
+ :param padding_y: The padding size on the y axis .
2503
2512
:type padding_y: int
2504
- :param dilation: The x dimension of the dilation. Or input a tuple for two
2505
- image dimension
2513
+ :param dilation: The dimensions of the dilation. If the parameter is set to one integer,
2514
+ the two dimensions on x and y axises will be same when dilation_y is not
2515
+ set. If it is set to a list, the first element indicates the dimension
2516
+ on the x axis, and the second is used to specify the dimension on the y
2517
+ axis when dilation_y is not provided. 1 is the default dimension.
2506
2518
:type dilation: int | tuple | list
2507
- :param dilation_y: The y dimension of the dilation.
2519
+ :param dilation_y: The dimension of the dilation on the y axis .
2508
2520
:type dilation_y: int
2509
2521
:param bias_attr: The bias attribute. If the parameter is set to False or an object
2510
2522
whose type is not ParameterAttribute, no bias is defined. If the
2511
2523
parameter is set to True, the bias is initialized to zero.
2512
2524
:type bias_attr: ParameterAttribute | None | bool | Any
2513
- :param num_channels: number of input channels. If None will be set
2514
- automatically from previous output.
2525
+ :param num_channels: The number of input channels. If the parameter is not set or
2526
+ set to None, its actual value will be automatically set to
2527
+ the channel number of the input.
2515
2528
:type num_channels: int
2516
- :param param_attr: Convolution param attribute. None means default attribute
2529
+ :param param_attr: The parameter attribute. See ParameterAttribute for
2530
+ details.
2517
2531
:type param_attr: ParameterAttribute
2518
- :param shared_biases: Is biases will be shared between filters or not.
2532
+ :param shared_biases: Whether biases will be shared between filters or not.
2519
2533
:type shared_biases: bool
2520
- :param layer_attr: Layer Extra Attribute.
2534
+ :param layer_attr: The extra layer attributes. See ExtraLayerAttribute for
2535
+ details.
2521
2536
:type layer_attr: ExtraLayerAttribute
2522
- :param trans: true if it is a convTransLayer, false if it is a convLayer
2537
+ :param trans: True if it is a convTransLayer, False if it is a convLayer
2523
2538
:type trans: bool
2524
- :param layer_type: specify the layer_type, default is None . If trans=True,
2525
- layer_type has to be "exconvt " or "cudnn_convt",
2526
- otherwise layer_type has to be either "exconv " or
2527
- " cudnn_conv"
2528
- :type layer_type: String
2539
+ :param layer_type: Specify the layer type . If the dilation's dimension on one axis is
2540
+ larger than 1, layer_type has to be "cudnn_conv " or "cudnn_convt".
2541
+ If trans=True, layer_type has to be "exconvt " or "cudnn_convt",
2542
+ otherwise layer_type has to be either "exconv" or " cudnn_conv".
2543
+ :type layer_type: basestring
2529
2544
:return: LayerOutput object.
2530
2545
:rtype: LayerOutput
2531
2546
"""
@@ -2628,7 +2643,7 @@ def img_pool_layer(input,
2628
2643
"""
2629
2644
Image pooling Layer.
2630
2645
2631
- The details of pooling layer, please refer ufldl's pooling_ .
2646
+ The details of pooling layer, please refer to ufldl's pooling_ .
2632
2647
2633
2648
.. _pooling: http://ufldl.stanford.edu/tutorial/supervised/Pooling/
2634
2649
@@ -2660,32 +2675,37 @@ def img_pool_layer(input,
2660
2675
padding_y=2,
2661
2676
pool_type=MaxPooling())
2662
2677
2663
- :param padding: pooling padding width .
2678
+ :param padding: The padding size on the x axis. 0 is the default padding size .
2664
2679
:type padding: int
2665
- :param padding_y: pooling padding height. It's equal to padding by default.
2666
- :type padding_y: int | None
2667
- :param name: name of pooling layer
2668
- :type name: basestring.
2680
+ :param padding_y: The padding size on the y axis. If the parameter is not set
2681
+ or set to None, it will be set to 'padding' automatically.
2682
+ :param name: The name of this layer. It is optional.
2683
+ :type name: basestring
2669
2684
:param input: The input of this layer.
2670
2685
:type input: LayerOutput
2671
- :param pool_size: pooling window width
2686
+ :param pool_size: The pooling window length on the x axis.
2672
2687
:type pool_size: int
2673
- :param pool_size_y: pooling window height. It's eaqual to pool_size by default.
2674
- :type pool_size_y: int | None
2675
- :param num_channels: number of input channel.
2688
+ :param pool_size_y: The pooling window length on the y axis. If the parameter is
2689
+ not set or set to None, its actual value will be automatically
2690
+ set to pool_size.
2691
+ :type pool_size_y: int
2692
+ :param num_channels: The number of input channels. If the parameter is not set or
2693
+ set to None, its actual value will be automatically set to
2694
+ the channels number of the input.
2676
2695
:type num_channels: int
2677
- :param pool_type: pooling type. MaxPooling or AvgPooling. Default is
2678
- MaxPooling.
2696
+ :param pool_type: Pooling type. MaxPooling is the default pooling.
2679
2697
:type pool_type: BasePoolingType
2680
- :param stride: stride width of pooling .
2698
+ :param stride: The stride on the x axis. 1 is the default value .
2681
2699
:type stride: int
2682
- :param stride_y: stride height of pooling. It is equal to stride by default.
2683
- :type stride_y: int | None
2684
- :param layer_attr: Extra Layer attribute.
2700
+ :param stride_y: The stride on the y axis. If the parameter is not set or set to
2701
+ None, its actual value will be automatically set to 'stride'.
2702
+ :type stride_y: int
2703
+ :param layer_attr: The extra layer attribute. See ExtraLayerAttribute for
2704
+ details.
2685
2705
:type layer_attr: ExtraLayerAttribute
2686
- :param ceil_mode: Wether to use ceil mode to calculate output height and with .
2687
- Defalut is True . If set false, Otherwise use floor.
2688
-
2706
+ :param ceil_mode: Wether to use the ceil function to calculate output height and width .
2707
+ True is the default . If it is set to False, the floor function will
2708
+ be used.
2689
2709
:type ceil_mode: bool
2690
2710
:return: LayerOutput object.
2691
2711
:rtype: LayerOutput
@@ -2791,24 +2811,32 @@ def img_pool3d_layer(input,
2791
2811
2792
2812
:param padding: pooling padding width.
2793
2813
:type padding: int | tuple | list
2794
- :param name: name of pooling layer
2814
+ :param name: The name of this layer. It is optional.
2795
2815
:type name: basestring.
2796
2816
:param input: The input of this layer.
2797
2817
:type input: LayerOutput
2798
- :param pool_size: pooling window width
2818
+ :param pool_size: The pooling window lengths along three axises. If the parameter
2819
+ is set to one integer, the three lengths will be same.
2799
2820
:type pool_size: int | tuple | list
2800
- :param num_channels: number of input channel.
2821
+ :param num_channels: The number of input channels. If the parameter is not set or
2822
+ set to None, its actual value will be automatically set to
2823
+ the channels number of the input.
2801
2824
:type num_channels: int
2802
- :param pool_type: pooling type. MaxPooling or AvgPooling. Default is
2803
- MaxPooling.
2825
+ :param pool_type: Pooling type. MaxPooling is the default pooling.
2804
2826
:type pool_type: BasePoolingType
2805
- :param stride: stride width of pooling.
2827
+ :param stride: The strides of the pooling along three axises. If the parameter
2828
+ is set to one integer, the three strides will be same. 1 is the
2829
+ default value.
2806
2830
:type stride: int | tuple | list
2807
- :param layer_attr: Extra Layer attribute.
2831
+ :param padding: The sizes of padding along three axises. If the parameter is set to
2832
+ one integer, they will be same. 0 is the default padding size.
2833
+ :type padding: int | tuple | list
2834
+ :param layer_attr: The extra layer attribute. See ExtraLayerAttribute for
2835
+ details.
2808
2836
:type layer_attr: ExtraLayerAttribute
2809
- :param ceil_mode: Wether to use ceil mode to calculate output height and with .
2810
- Defalut is True . If set false, Otherwise use floor.
2811
-
2837
+ :param ceil_mode: Wether to use the ceil function to calculate output height and width .
2838
+ True is the default . If it is set to False, the floor function will
2839
+ be used.
2812
2840
:type ceil_mode: bool
2813
2841
:return: LayerOutput object.
2814
2842
:rtype: LayerOutput
@@ -2887,9 +2915,11 @@ def spp_layer(input,
2887
2915
pyramid_height = None ,
2888
2916
layer_attr = None ):
2889
2917
"""
2890
- Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition.
2891
- The details please refer to
2892
- `Kaiming He's paper <https://arxiv.org/abs/1406.4729>`_.
2918
+ A layer performs spatial pyramid pooling.
2919
+
2920
+ Reference:
2921
+ Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition
2922
+ https://arxiv.org/abs/1406.4729
2893
2923
2894
2924
The example usage is:
2895
2925
@@ -2904,13 +2934,16 @@ def spp_layer(input,
2904
2934
:type name: basestring
2905
2935
:param input: The input of this layer.
2906
2936
:type input: LayerOutput
2907
- :param num_channels: number of input channel.
2937
+ :param num_channels: The number of input channels. If the parameter is not set or
2938
+ set to None, its actual value will be automatically set to
2939
+ the channels number of the input.
2908
2940
:type num_channels: int
2909
- :param pool_type: Pooling type. MaxPooling or AveragePooling. Default is MaxPooling .
2941
+ :param pool_type: Pooling type. MaxPooling is the default pooling .
2910
2942
:type scale: BasePoolingType
2911
- :param pyramid_height: pyramid height.
2943
+ :param pyramid_height: The pyramid height of this pooling .
2912
2944
:type pyramid_height: int
2913
- :param layer_attr: Extra Layer Attribute.
2945
+ :param layer_attr: The extra layer attribute. See ExtraLayerAttribute for
2946
+ details.
2914
2947
:type layer_attr: ExtraLayerAttribute
2915
2948
:return: LayerOutput object.
2916
2949
:rtype: LayerOutput
@@ -4604,7 +4637,7 @@ def conv_projection(input,
4604
4637
will be same when filter_size_y is not set. If it is set
4605
4638
to a list, the first element indicates the dimension on
4606
4639
the x axis, and the second is used to specify the dimension
4607
- on the y axis when filter_size is not provided.
4640
+ on the y axis when filter_size_y is not provided.
4608
4641
:type filter_size: int | tuple | list
4609
4642
:param filter_size_y: The dimension of the filter kernel on the y axis. If the parameter
4610
4643
is not set, it will be set automatically according to filter_size.
@@ -6986,7 +7019,7 @@ def img_conv3d_layer(input,
6986
7019
:type layer_attr: ExtraLayerAttribute
6987
7020
:param trans: True if it is a convTransLayer, False if it is a convLayer
6988
7021
:type trans: bool
6989
- :param layer_type: Specify the layer_type . If the parameter is set, it must be "deconv3d"
7022
+ :param layer_type: Specify the layer type . If the parameter is set, it must be "deconv3d"
6990
7023
when trans=True. If not set, it will be automatically set to "deconv3d"
6991
7024
when trans=True and "conv3d" when trans=False.
6992
7025
:type layer_type: basestring
0 commit comments