Applies a 2D fractional max pooling over an input signal composed of several input planes.
Ben Graham的这篇文章[Fractional MaxPooling](http://arxiv.org/abs/1412.6071)中详细地介绍了小数级二维最大池化的基本思想和技术细节。
Fractional MaxPooling is described in detail in the paper [Fractional MaxPooling](http://arxiv.org/abs/1412.6071) by Ben Graham
The max-pooling operation is applied in ![](img/52ec12db6613ee8a0f6f41143ab2e8a2.jpg) regions by a stochastic step size determined by the target output size. The number of output features is equal to the number of input planes.
***kernel_size** – the size of the window to take a max over. Can be a single number k (for a square kernel of k x k) or a tuple `(kh x kw)`
***output_size** – the target output size of the image of the form `oH x oW`. Can be a tuple `(oH, oW)` or a single number oH for a square image `oH x oH`
***output_ratio** – If one wants to have an output size as a ratio of the input size, this option can be given. This has to be a number or tuple in the range (0, 1)
***return_indices** – if `True`, will return the indices along with the outputs. Useful to pass to `nn.MaxUnpool2d()`. Default: `False`
***kernel_size** – 执行最大操作的窗口大小。支持的数据类型包括一个单独的数字k(生成一个大小为k x k的正方形kernal),或者一个元组 `(kh x kw)`
***output_size** – 池化输出目标大小,具体形式是 `oH x oW`。支持的数据类型包括一个单独的数字`oH`,或者一个元组 `(oH, oW)`,注意此处`oH x oW`与`kernal_size`中的`kh x ow`相呼应,两者成一定的小数级倍数关系
Applies a 2D adaptive max pooling over an input signal composed of several input planes.
对输入的多通道信号进行2维的自适应最大池化操作。
The output is of size H x W, for any input size. The number of output features is equal to the number of input planes.
此池化层可以通过指定输出大小H x W,将任意输入大小的输入强行的池化到指定的输出大小。不过输入和输出特征的通道数不会变化。
Parameters:
***output_size** – the target output size of the image of the form H x W. Can be a tuple (H, W) or a single H for a square image H x H. H and W can be either a `int`, or `None` which means the size will be the same as that of the input.
***return_indices** – if `True`, will return the indices along with the outputs. Useful to pass to nn.MaxUnpool2d. Default: `False`
***output_size** – 指定的输出大小H x W。此参数支持的数据类型可以是一个元组(H, W),又或者是一个单独的`int` H(等价于H x H)。H 和 W这两个参数支持输入一个`int`又或者是`None`, `None`表示此输出维度的大小等价于输入数据此维度的大小
Applies a 3D adaptive max pooling over an input signal composed of several input planes.
The output is of size D x H x W, for any input size. The number of output features is equal to the number of input planes.
此池化层可以通过指定输出大小D x H x W,将任意输入大小的输入强行的池化到指定的输出大小。不过输入和输出特征的通道数不会变化。
Parameters:
***output_size** – the target output size of the image of the form D x H x W. Can be a tuple (D, H, W) or a single D for a cube D x D x D. D, H and W can be either a `int`, or `None` which means the size will be the same as that of the input.
***return_indices** – if `True`, will return the indices along with the outputs. Useful to pass to nn.MaxUnpool3d. Default: `False`
***output_size** – 指定的输出大小D x H x W。此参数支持的数据类型可以是一个元组(D, H, W),又或者是一个单独的`int` D(等价于D x D x D)。D, H 和 W这三个参数支持输入一个`int`又或者是`None`, `None`表示此输出维度的大小等价于输入数据此维度的大小
| Parameters: | **output_size** – the target output size H |
| --- | --- |
Parameters:
***output_size** – 指定的输出大小H
Examples
例子
```py
>>># target output size of 5
...
...
@@ -2312,14 +2299,16 @@ Examples
classtorch.nn.AdaptiveAvgPool2d(output_size)
```
Applies a 2D adaptive average pooling over an input signal composed of several input planes.
对输入的多通道信号进行2维的自适应平均池化操作。
The output is of size H x W, for any input size. The number of output features is equal to the number of input planes.
此池化层可以通过指定输出大小H x W,将任意输入大小的输入强行的池化到指定的输出大小。不过输入和输出特征的通道数不会变化。
| Parameters: | **output_size** – the target output size of the image of the form H x W. Can be a tuple (H, W) or a single H for a square image H x H H and W can be either a `int`, or `None` which means the size will be the same as that of the input. |
| --- | --- |
Parameters:
***output_size** – 指定的输出大小H x W。此参数支持的数据类型可以是一个元组(H, W),又或者是一个单独的`int` H(等价于H x H)。H 和 W这两个参数支持输入一个`int`又或者是`None`, `None`表示此输出维度的大小等价于输入数据此维度的大小
例子
Examples
```py
>>># target output size of 5x7
...
...
@@ -2343,14 +2332,16 @@ Examples
classtorch.nn.AdaptiveAvgPool3d(output_size)
```
Applies a 3D adaptive average pooling over an input signal composed of several input planes.
对输入的多通道信号进行3维的自适应平均池化操作。
The output is of size D x H x W, for any input size. The number of output features is equal to the number of input planes.
此池化层可以通过指定输出大小D x H x W,将任意输入大小的输入强行的池化到指定的输出大小。不过输入和输出特征的通道数不会变化。
| Parameters: | **output_size** – the target output size of the form D x H x W. Can be a tuple (D, H, W) or a single number D for a cube D x D x D D, H and W can be either a `int`, or `None` which means the size will be the same as that of the input. |
| --- | --- |
Parameters:
***output_size** – 指定的输出大小D x H x W。此参数支持的数据类型可以是一个元组(D, H, W),又或者是一个单独的`int` D(等价于D x D x D)。D, H 和 W这三个参数支持输入一个`int`又或者是`None`, `None`表示此输出维度的大小等价于输入数据此维度的大小