AveragePool - 7 vs 10¶
- AveragePool7 → AveragePool10 +11 -0
AveragePool7 → AveragePool10
RENAMED
@@ -1 +1 @@
|
|
1
1
|
AveragePool consumes an input tensor X and applies average pooling across
|
2
2
|
the tensor according to kernel sizes, stride sizes, and pad lengths.
|
3
3
|
average pooling consisting of computing the average on all values of a
|
4
4
|
subset of the input tensor according to the kernel size and downsampling the
|
5
5
|
data into the output tensor Y for further processing. The output spatial shape will be following:
|
6
6
|
::
|
7
7
|
output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)
|
8
|
+
|
9
|
+
or
|
10
|
+
::
|
11
|
+
|
12
|
+
output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)
|
13
|
+
|
14
|
+
if ceil_mode is enabled
|
15
|
+
|
16
|
+
::
|
8
17
|
* pad_shape[i] is sum of pads along axis i
|
9
18
|
auto_pad is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:
|
10
19
|
::
|
11
20
|
VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - kernel_spatial_shape[i] + 1) / strides_spatial_shape[i])
|
12
21
|
SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])
|
13
22
|
And pad shape will be following if SAME_UPPER or SAME_LOWER:
|
14
23
|
::
|
15
24
|
pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + kernel_spatial_shape[i] - input_spatial_shape[i]
|
16
25
|
The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).
|
17
26
|
**Attributes**
|
18
27
|
* **auto_pad**:
|
19
28
|
auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID.
|
20
29
|
Where default value is NOTSET, which means explicit padding is used.
|
21
30
|
SAME_UPPER or SAME_LOWER mean pad the input so that the output
|
22
31
|
spatial size match the input.In case of odd number add the extra
|
23
32
|
padding at the end for SAME_UPPER and at the beginning for
|
24
33
|
SAME_LOWER. VALID mean no padding.
|
34
|
+
* **ceil_mode**:
|
35
|
+
Whether to use ceil or floor (default) to compute the output shape.
|
25
36
|
* **count_include_pad**:
|
26
37
|
Whether include pad pixels when calculating values for the edges.
|
27
38
|
Default is 0, doesn't count include pad.
|
28
39
|
* **kernel_shape** (required):
|
29
40
|
The size of the kernel along each axis.
|
30
41
|
* **pads**:
|
31
42
|
Padding for the beginning and ending along each spatial axis, it can
|
32
43
|
take any value greater than or equal to 0. The value represent the
|
33
44
|
number of pixels added to the beginning and end part of the
|
34
45
|
corresponding axis. pads format should be as follow [x1_begin,
|
35
46
|
x2_begin...x1_end, x2_end,...], where xi_begin the number of pixels
|
36
47
|
added at the beginning of axis i and xi_end, the number of pixels
|
37
48
|
added at the end of axis i. This attribute cannot be used
|
38
49
|
simultaneously with auto_pad attribute. If not present, the padding
|
39
50
|
defaults to 0 along start and end of each spatial axis.
|
40
51
|
* **strides**:
|
41
52
|
Stride along each spatial axis.
|
42
53
|
**Inputs**
|
43
54
|
* **X** (heterogeneous) - **T**:
|
44
55
|
Input data tensor from the previous operator; dimensions for image
|
45
56
|
case are (N x C x H x W), where N is the batch size, C is the number
|
46
57
|
of channels, and H and W are the height and the width of the data.
|
47
58
|
For non image case, the dimensions are in the form of (N x C x D1 x
|
48
59
|
D2 ... Dn), where N is the batch size. Optionally, if dimension
|
49
60
|
denotation is in effect, the operation expects the input data tensor
|
50
61
|
to arrive with the dimension denotation of [DATA_BATCH,
|
51
62
|
DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE ...].
|
52
63
|
**Outputs**
|
53
64
|
* **Y** (heterogeneous) - **T**:
|
54
65
|
Output data tensor from average or max pooling across the input
|
55
66
|
tensor. Dimensions will vary based on various kernel, stride, and
|
56
67
|
pad sizes. Floor value of the dimension is used
|
57
68
|
**Type Constraints**
|
58
69
|
* **T** in (
|
59
70
|
tensor(double),
|
60
71
|
tensor(float),
|
61
72
|
tensor(float16)
|
62
73
|
):
|
63
74
|
Constrain input and output types to float tensors.
|