MaxPool - 10 vs 12#
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 → MaxPool12 +8 -14
MaxPool10 → MaxPool12
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
|
-
SAME_UPPER or SAME_LOWER mean pad the input so that
|
26
|
+
SAME_UPPER or SAME_LOWER mean pad the input so that the output
|
27
|
+
spatial size match the input.In case of odd number add the extra
|
28
|
+
padding at the end for SAME_UPPER and at the beginning for
|
29
|
+
SAME_LOWER. VALID mean no padding.
|
27
|
-
= ceil(input_shape[i] / strides[i]) for each axis i. The padding
|
28
|
-
is split between the two sides equally or almost equally (depending
|
29
|
-
on whether it is even or odd). In case the padding is an odd number,
|
30
|
-
the extra padding is added at the end for SAME_UPPER and at the
|
31
|
-
beginning for SAME_LOWER.
|
32
30
|
* **ceil_mode**:
|
33
31
|
Whether to use ceil or floor (default) to compute the output shape.
|
34
32
|
* **dilations**:
|
35
|
-
Dilation value along each spatial axis of filter.
|
33
|
+
Dilation value along each spatial axis of filter.
|
36
|
-
the dilation defaults to 1 along each spatial axis.
|
37
34
|
* **kernel_shape** (required):
|
38
35
|
The size of the kernel along each axis.
|
39
36
|
* **pads**:
|
40
37
|
Padding for the beginning and ending along each spatial axis, it can
|
41
38
|
take any value greater than or equal to 0. The value represent the
|
42
39
|
number of pixels added to the beginning and end part of the
|
43
40
|
corresponding axis. pads format should be as follow [x1_begin,
|
44
41
|
x2_begin...x1_end, x2_end,...], where xi_begin the number of pixels
|
45
42
|
added at the beginning of axis i and xi_end, the number of pixels
|
46
43
|
added at the end of axis i. This attribute cannot be used
|
47
44
|
simultaneously with auto_pad attribute. If not present, the padding
|
48
45
|
defaults to 0 along start and end of each spatial axis.
|
49
46
|
* **storage_order**:
|
50
47
|
The storage order of the tensor. 0 is row major, and 1 is column
|
51
48
|
major.
|
52
49
|
* **strides**:
|
53
|
-
Stride along each spatial axis. If not present, the stride defaults
|
54
|
-
|
50
|
+
Stride along each spatial axis.
|
55
51
|
**Inputs**
|
56
52
|
* **X** (heterogeneous) - **T**:
|
57
53
|
Input data tensor from the previous operator; dimensions for image
|
58
54
|
case are (N x C x H x W), where N is the batch size, C is the number
|
59
55
|
of channels, and H and W are the height and the width of the data.
|
60
56
|
For non image case, the dimensions are in the form of (N x C x D1 x
|
61
57
|
D2 ... Dn), where N is the batch size. Optionally, if dimension
|
62
58
|
denotation is in effect, the operation expects the input data tensor
|
63
59
|
to arrive with the dimension denotation of [DATA_BATCH,
|
64
60
|
DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE ...].
|
65
61
|
**Outputs**
|
66
62
|
Between 1 and 2 outputs.
|
67
63
|
* **Y** (heterogeneous) - **T**:
|
68
64
|
Output data tensor from average or max pooling across the input
|
69
65
|
tensor. Dimensions will vary based on various kernel, stride, and
|
70
66
|
pad sizes. Floor value of the dimension is used
|
71
67
|
* **Indices** (optional, heterogeneous) - **I**:
|
72
68
|
Indices tensor from max pooling across the input tensor. The
|
73
69
|
dimensions of indices are the same as output tensor. The values in
|
74
70
|
indices of are the indices of the selected values during pooling.
|
75
71
|
The indices are computed as flatten 1-D tensor, and the indices do
|
76
72
|
not consider padding. So the values in indices are in [0, N x C x D1
|
77
73
|
x ... x Dn).
|
78
74
|
**Type Constraints**
|
79
75
|
* **T** in (
|
80
76
|
tensor(double),
|
81
77
|
tensor(float),
|
82
|
-
tensor(float16)
|
78
|
+
tensor(float16)
|
83
|
-
tensor(int8),
|
84
|
-
tensor(uint8)
|
85
79
|
):
|
86
|
-
Constrain input and output types to float
|
80
|
+
Constrain input and output types to float tensors.
|
87
81
|
* **I** in (
|
88
82
|
tensor(int64)
|
89
83
|
):
|
90
84
|
Constrain index tensor to int64
|