@@ -2507,12 +2507,12 @@ def img_conv_layer(input,
2507
2507
input is raw pixels of image(mono or RGB), or it may be the previous layer's
2508
2508
num_filters * num_group.
2509
2509
2510
- There are several group of filter in PaddlePaddle implementation.
2511
- Each group will process some channel of the inputs . For example, if an input
2510
+ There are several groups of filters in PaddlePaddle implementation.
2511
+ Each group will process some channels of the input . For example, if
2512
2512
num_channel = 256, group = 4, num_filter=32, the PaddlePaddle will create
2513
- 32*4 = 128 filters to process inputs . The channels will be split into 4
2514
- pieces. First 256/4 = 64 channels will process by first 32 filters. The
2515
- rest channels will be processed by rest group of filters.
2513
+ 32*4 = 128 filters to process the input . The channels will be split into 4
2514
+ pieces. First 256/4 = 64 channels will be processed by first 32 filters. The
2515
+ rest channels will be processed by the rest groups of filters.
2516
2516
2517
2517
The example usage is:
2518
2518
@@ -2528,53 +2528,68 @@ def img_conv_layer(input,
2528
2528
:type name: basestring
2529
2529
:param input: The input of this layer.
2530
2530
:type input: LayerOutput
2531
- :param filter_size: The x dimension of a filter kernel. Or input a tuple for
2532
- two image dimension.
2531
+ :param filter_size: The dimensions of the filter kernel. If the parameter is
2532
+ set to one integer, the two dimensions on x and y axises
2533
+ will be same when filter_size_y is not set. If it is set
2534
+ to a list, the first element indicates the dimension on
2535
+ the x axis, and the second is used to specify the dimension
2536
+ on the y axis when filter_size_y is not provided.
2533
2537
:type filter_size: int | tuple | list
2534
- :param filter_size_y: The y dimension of a filter kernel. Since PaddlePaddle
2535
- currently supports rectangular filters, the filter's
2536
- shape will be (filter_size, filter_size_y).
2537
- :type filter_size_y: int | None
2538
+ :param filter_size_y: The dimension of the filter kernel on the y axis. If the parameter
2539
+ is not set, it will be set automatically according to filter_size.
2540
+ :type filter_size_y: int
2538
2541
:param num_filters: Each filter group's number of filter
2539
2542
:param act: Activation type. ReluActivation is the default activation.
2540
2543
:type act: BaseActivation
2541
- :param groups: Group size of filters .
2544
+ :param groups: The group number. 1 is the default group number .
2542
2545
:type groups: int
2543
- :param stride: The x dimension of the stride. Or input a tuple for two image
2544
- dimension.
2546
+ :param stride: The strides. If the parameter is set to one integer, the strides
2547
+ on x and y axises will be same when stride_y is not set. If it is
2548
+ set to a list, the first element indicates the stride on the x axis,
2549
+ and the second is used to specify the stride on the y axis when
2550
+ stride_y is not provided. 1 is the default value.
2545
2551
:type stride: int | tuple | list
2546
- :param stride_y: The y dimension of the stride .
2552
+ :param stride_y: The stride on the y axis .
2547
2553
:type stride_y: int
2548
- :param padding: The x dimension of the padding. Or input a tuple for two
2549
- image dimension
2554
+ :param padding: The padding sizes. If the parameter is set to one integer, the padding
2555
+ sizes on x and y axises will be same when padding_y is not set. If it
2556
+ is set to a list, the first element indicates the padding size on the
2557
+ x axis, and the second is used to specify the padding size on the y axis
2558
+ when padding_y is not provided. 0 is the default padding size.
2550
2559
:type padding: int | tuple | list
2551
- :param padding_y: The y dimension of the padding .
2560
+ :param padding_y: The padding size on the y axis .
2552
2561
:type padding_y: int
2553
- :param dilation: The x dimension of the dilation. Or input a tuple for two
2554
- image dimension
2562
+ :param dilation: The dimensions of the dilation. If the parameter is set to one integer,
2563
+ the two dimensions on x and y axises will be same when dilation_y is not
2564
+ set. If it is set to a list, the first element indicates the dimension
2565
+ on the x axis, and the second is used to specify the dimension on the y
2566
+ axis when dilation_y is not provided. 1 is the default dimension.
2555
2567
:type dilation: int | tuple | list
2556
- :param dilation_y: The y dimension of the dilation.
2568
+ :param dilation_y: The dimension of the dilation on the y axis .
2557
2569
:type dilation_y: int
2558
2570
:param bias_attr: The bias attribute. If the parameter is set to False or an object
2559
2571
whose type is not ParameterAttribute, no bias is defined. If the
2560
2572
parameter is set to True, the bias is initialized to zero.
2561
2573
:type bias_attr: ParameterAttribute | None | bool | Any
2562
- :param num_channels: number of input channels. If None will be set
2563
- automatically from previous output.
2574
+ :param num_channels: The number of input channels. If the parameter is not set or
2575
+ set to None, its actual value will be automatically set to
2576
+ the channel number of the input.
2564
2577
:type num_channels: int
2565
- :param param_attr: Convolution param attribute. None means default attribute
2578
+ :param param_attr: The parameter attribute. See ParameterAttribute for
2579
+ details.
2566
2580
:type param_attr: ParameterAttribute
2567
- :param shared_biases: Is biases will be shared between filters or not.
2581
+ :param shared_biases: Whether biases will be shared between filters or not.
2568
2582
:type shared_biases: bool
2569
- :param layer_attr: Layer Extra Attribute.
2583
+ :param layer_attr: The extra layer attributes. See ExtraLayerAttribute for
2584
+ details.
2570
2585
:type layer_attr: ExtraLayerAttribute
2571
- :param trans: true if it is a convTransLayer, false if it is a convLayer
2586
+ :param trans: True if it is a convTransLayer, False if it is a convLayer
2572
2587
:type trans: bool
2573
- :param layer_type: specify the layer_type, default is None . If trans=True,
2574
- layer_type has to be "exconvt " or "cudnn_convt",
2575
- otherwise layer_type has to be either "exconv " or
2576
- " cudnn_conv"
2577
- :type layer_type: String
2588
+ :param layer_type: Specify the layer type . If the dilation's dimension on one axis is
2589
+ larger than 1, layer_type has to be "cudnn_conv " or "cudnn_convt".
2590
+ If trans=True, layer_type has to be "exconvt " or "cudnn_convt",
2591
+ otherwise layer_type has to be either "exconv" or " cudnn_conv".
2592
+ :type layer_type: basestring
2578
2593
:return: LayerOutput object.
2579
2594
:rtype: LayerOutput
2580
2595
"""
@@ -2679,7 +2694,7 @@ def img_pool_layer(input,
2679
2694
"""
2680
2695
Image pooling Layer.
2681
2696
2682
- The details of pooling layer, please refer ufldl's pooling_ .
2697
+ The details of pooling layer, please refer to ufldl's pooling_ .
2683
2698
2684
2699
.. _pooling: http://ufldl.stanford.edu/tutorial/supervised/Pooling/
2685
2700
@@ -2711,32 +2726,37 @@ def img_pool_layer(input,
2711
2726
padding_y=2,
2712
2727
pool_type=MaxPooling())
2713
2728
2714
- :param padding: pooling padding width .
2729
+ :param padding: The padding size on the x axis. 0 is the default padding size .
2715
2730
:type padding: int
2716
- :param padding_y: pooling padding height. It's equal to padding by default.
2717
- :type padding_y: int | None
2718
- :param name: name of pooling layer
2719
- :type name: basestring.
2731
+ :param padding_y: The padding size on the y axis. If the parameter is not set
2732
+ or set to None, it will be set to 'padding' automatically.
2733
+ :param name: The name of this layer. It is optional.
2734
+ :type name: basestring
2720
2735
:param input: The input of this layer.
2721
2736
:type input: LayerOutput
2722
- :param pool_size: pooling window width
2737
+ :param pool_size: The pooling window length on the x axis.
2723
2738
:type pool_size: int
2724
- :param pool_size_y: pooling window height. It's eaqual to pool_size by default.
2725
- :type pool_size_y: int | None
2726
- :param num_channels: number of input channel.
2739
+ :param pool_size_y: The pooling window length on the y axis. If the parameter is
2740
+ not set or set to None, its actual value will be automatically
2741
+ set to pool_size.
2742
+ :type pool_size_y: int
2743
+ :param num_channels: The number of input channels. If the parameter is not set or
2744
+ set to None, its actual value will be automatically set to
2745
+ the channels number of the input.
2727
2746
:type num_channels: int
2728
- :param pool_type: pooling type. MaxPooling or AvgPooling. Default is
2729
- MaxPooling.
2747
+ :param pool_type: Pooling type. MaxPooling is the default pooling.
2730
2748
:type pool_type: BasePoolingType
2731
- :param stride: stride width of pooling .
2749
+ :param stride: The stride on the x axis. 1 is the default value .
2732
2750
:type stride: int
2733
- :param stride_y: stride height of pooling. It is equal to stride by default.
2734
- :type stride_y: int | None
2735
- :param layer_attr: Extra Layer attribute.
2751
+ :param stride_y: The stride on the y axis. If the parameter is not set or set to
2752
+ None, its actual value will be automatically set to 'stride'.
2753
+ :type stride_y: int
2754
+ :param layer_attr: The extra layer attribute. See ExtraLayerAttribute for
2755
+ details.
2736
2756
:type layer_attr: ExtraLayerAttribute
2737
- :param ceil_mode: Wether to use ceil mode to calculate output height and with .
2738
- Defalut is True . If set false, Otherwise use floor.
2739
-
2757
+ :param ceil_mode: Wether to use the ceil function to calculate output height and width .
2758
+ True is the default . If it is set to False, the floor function will
2759
+ be used.
2740
2760
:type ceil_mode: bool
2741
2761
:return: LayerOutput object.
2742
2762
:rtype: LayerOutput
@@ -2842,24 +2862,32 @@ def img_pool3d_layer(input,
2842
2862
2843
2863
:param padding: pooling padding width.
2844
2864
:type padding: int | tuple | list
2845
- :param name: name of pooling layer
2865
+ :param name: The name of this layer. It is optional.
2846
2866
:type name: basestring.
2847
2867
:param input: The input of this layer.
2848
2868
:type input: LayerOutput
2849
- :param pool_size: pooling window width
2869
+ :param pool_size: The pooling window lengths along three axises. If the parameter
2870
+ is set to one integer, the three lengths will be same.
2850
2871
:type pool_size: int | tuple | list
2851
- :param num_channels: number of input channel.
2872
+ :param num_channels: The number of input channels. If the parameter is not set or
2873
+ set to None, its actual value will be automatically set to
2874
+ the channels number of the input.
2852
2875
:type num_channels: int
2853
- :param pool_type: pooling type. MaxPooling or AvgPooling. Default is
2854
- MaxPooling.
2876
+ :param pool_type: Pooling type. MaxPooling is the default pooling.
2855
2877
:type pool_type: BasePoolingType
2856
- :param stride: stride width of pooling.
2878
+ :param stride: The strides of the pooling along three axises. If the parameter
2879
+ is set to one integer, the three strides will be same. 1 is the
2880
+ default value.
2857
2881
:type stride: int | tuple | list
2858
- :param layer_attr: Extra Layer attribute.
2882
+ :param padding: The sizes of padding along three axises. If the parameter is set to
2883
+ one integer, they will be same. 0 is the default padding size.
2884
+ :type padding: int | tuple | list
2885
+ :param layer_attr: The extra layer attribute. See ExtraLayerAttribute for
2886
+ details.
2859
2887
:type layer_attr: ExtraLayerAttribute
2860
- :param ceil_mode: Wether to use ceil mode to calculate output height and with .
2861
- Defalut is True . If set false, Otherwise use floor.
2862
-
2888
+ :param ceil_mode: Wether to use the ceil function to calculate output height and width .
2889
+ True is the default . If it is set to False, the floor function will
2890
+ be used.
2863
2891
:type ceil_mode: bool
2864
2892
:return: LayerOutput object.
2865
2893
:rtype: LayerOutput
@@ -2938,9 +2966,11 @@ def spp_layer(input,
2938
2966
pyramid_height = None ,
2939
2967
layer_attr = None ):
2940
2968
"""
2941
- Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition.
2942
- The details please refer to
2943
- `Kaiming He's paper <https://arxiv.org/abs/1406.4729>`_.
2969
+ A layer performs spatial pyramid pooling.
2970
+
2971
+ Reference:
2972
+ Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition
2973
+ https://arxiv.org/abs/1406.4729
2944
2974
2945
2975
The example usage is:
2946
2976
@@ -2955,13 +2985,16 @@ def spp_layer(input,
2955
2985
:type name: basestring
2956
2986
:param input: The input of this layer.
2957
2987
:type input: LayerOutput
2958
- :param num_channels: number of input channel.
2988
+ :param num_channels: The number of input channels. If the parameter is not set or
2989
+ set to None, its actual value will be automatically set to
2990
+ the channels number of the input.
2959
2991
:type num_channels: int
2960
- :param pool_type: Pooling type. MaxPooling or AveragePooling. Default is MaxPooling .
2992
+ :param pool_type: Pooling type. MaxPooling is the default pooling .
2961
2993
:type scale: BasePoolingType
2962
- :param pyramid_height: pyramid height.
2994
+ :param pyramid_height: The pyramid height of this pooling .
2963
2995
:type pyramid_height: int
2964
- :param layer_attr: Extra Layer Attribute.
2996
+ :param layer_attr: The extra layer attribute. See ExtraLayerAttribute for
2997
+ details.
2965
2998
:type layer_attr: ExtraLayerAttribute
2966
2999
:return: LayerOutput object.
2967
3000
:rtype: LayerOutput
@@ -4694,7 +4727,7 @@ def conv_projection(input,
4694
4727
will be same when filter_size_y is not set. If it is set
4695
4728
to a list, the first element indicates the dimension on
4696
4729
the x axis, and the second is used to specify the dimension
4697
- on the y axis when filter_size is not provided.
4730
+ on the y axis when filter_size_y is not provided.
4698
4731
:type filter_size: int | tuple | list
4699
4732
:param filter_size_y: The dimension of the filter kernel on the y axis. If the parameter
4700
4733
is not set, it will be set automatically according to filter_size.
@@ -7076,7 +7109,7 @@ def img_conv3d_layer(input,
7076
7109
:type layer_attr: ExtraLayerAttribute
7077
7110
:param trans: True if it is a convTransLayer, False if it is a convLayer
7078
7111
:type trans: bool
7079
- :param layer_type: Specify the layer_type . If the parameter is set, it must be "deconv3d"
7112
+ :param layer_type: Specify the layer type . If the parameter is set, it must be "deconv3d"
7080
7113
when trans=True. If not set, it will be automatically set to "deconv3d"
7081
7114
when trans=True and "conv3d" when trans=False.
7082
7115
:type layer_type: basestring
0 commit comments