MaxPool - 10 vs 11#
Next section compares an older to a newer version of the same operator after both definition are converted into markdown text. Green means an addition to the newer version, red means a deletion. Anything else is unchanged.
- MaxPool10 → MaxPool11 +2 -4
MaxPool10 → MaxPool11
RENAMED
@@ -1 +1 @@
|
|
1
1
|
MaxPool consumes an input tensor X and applies max pooling across
|
2
2
|
the tensor according to kernel sizes, stride sizes, and pad lengths.
|
3
3
|
max pooling consisting of computing the max 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] - 1) * dilations[i] + 1)) / strides_spatial_shape[i] + 1)
|
8
8
|
or
|
9
9
|
::
|
10
10
|
output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1)) / strides_spatial_shape[i] + 1)
|
11
11
|
if ceil_mode is enabled
|
12
12
|
::
|
13
13
|
* pad_shape[i] is sum of pads along axis i
|
14
14
|
auto_pad is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:
|
15
15
|
::
|
16
16
|
VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) + 1) / strides_spatial_shape[i])
|
17
17
|
SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])
|
18
18
|
And pad shape will be following if SAME_UPPER or SAME_LOWER:
|
19
19
|
::
|
20
20
|
pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) - input_spatial_shape[i]
|
21
21
|
The output of each pooling window is maximum number of elements exclude pad.
|
22
22
|
**Attributes**
|
23
23
|
* **auto_pad**:
|
24
24
|
auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID.
|
25
25
|
Where default value is NOTSET, which means explicit padding is used.
|
26
26
|
SAME_UPPER or SAME_LOWER mean pad the input so that the output
|
27
27
|
spatial size match the input.In case of odd number add the extra
|
28
28
|
padding at the end for SAME_UPPER and at the beginning for
|
29
29
|
SAME_LOWER. VALID mean no padding.
|
30
30
|
* **ceil_mode**:
|
31
31
|
Whether to use ceil or floor (default) to compute the output shape.
|
32
32
|
* **dilations**:
|
33
|
-
Dilation value along each spatial axis of filter.
|
33
|
+
Dilation value along each spatial axis of filter.
|
34
|
-
the dilation defaults to 1 along each spatial axis.
|
35
34
|
* **kernel_shape** (required):
|
36
35
|
The size of the kernel along each axis.
|
37
36
|
* **pads**:
|
38
37
|
Padding for the beginning and ending along each spatial axis, it can
|
39
38
|
take any value greater than or equal to 0. The value represent the
|
40
39
|
number of pixels added to the beginning and end part of the
|
41
40
|
corresponding axis. pads format should be as follow [x1_begin,
|
42
41
|
x2_begin...x1_end, x2_end,...], where xi_begin the number of pixels
|
43
42
|
added at the beginning of axis i and xi_end, the number of pixels
|
44
43
|
added at the end of axis i. This attribute cannot be used
|
45
44
|
simultaneously with auto_pad attribute. If not present, the padding
|
46
45
|
defaults to 0 along start and end of each spatial axis.
|
47
46
|
* **storage_order**:
|
48
47
|
The storage order of the tensor. 0 is row major, and 1 is column
|
49
48
|
major.
|
50
49
|
* **strides**:
|
51
|
-
Stride along each spatial axis. If not present, the stride defaults
|
52
|
-
|
50
|
+
Stride along each spatial axis.
|
53
51
|
**Inputs**
|
54
52
|
* **X** (heterogeneous) - **T**:
|
55
53
|
Input data tensor from the previous operator; dimensions for image
|
56
54
|
case are (N x C x H x W), where N is the batch size, C is the number
|
57
55
|
of channels, and H and W are the height and the width of the data.
|
58
56
|
For non image case, the dimensions are in the form of (N x C x D1 x
|
59
57
|
D2 ... Dn), where N is the batch size. Optionally, if dimension
|
60
58
|
denotation is in effect, the operation expects the input data tensor
|
61
59
|
to arrive with the dimension denotation of [DATA_BATCH,
|
62
60
|
DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE ...].
|
63
61
|
**Outputs**
|
64
62
|
Between 1 and 2 outputs.
|
65
63
|
* **Y** (heterogeneous) - **T**:
|
66
64
|
Output data tensor from average or max pooling across the input
|
67
65
|
tensor. Dimensions will vary based on various kernel, stride, and
|
68
66
|
pad sizes. Floor value of the dimension is used
|
69
67
|
* **Indices** (optional, heterogeneous) - **I**:
|
70
68
|
Indices tensor from max pooling across the input tensor. The
|
71
69
|
dimensions of indices are the same as output tensor. The values in
|
72
70
|
indices of are the indices of the selected values during pooling.
|
73
71
|
The indices are computed as flatten 1-D tensor, and the indices do
|
74
72
|
not consider padding. So the values in indices are in [0, N x C x D1
|
75
73
|
x ... x Dn).
|
76
74
|
**Type Constraints**
|
77
75
|
* **T** in (
|
78
76
|
tensor(double),
|
79
77
|
tensor(float),
|
80
78
|
tensor(float16)
|
81
79
|
):
|
82
80
|
Constrain input and output types to float tensors.
|
83
81
|
* **I** in (
|
84
82
|
tensor(int64)
|
85
83
|
):
|
86
84
|
Constrain index tensor to int64
|