2D Average Pooling Forward Layer

The forward two-dimensional (2D) average pooling layer is a form of non-linear downsampling of an input tensor X = (x (1) ... x (p)) of size n 1 x n 2 x ... x n p . 2D average pooling partitions the input tensor data into 2D subtensors by two dimensions k 1 and k 2, computes the average value of elements in each subtensor, and transforms the input tensor to the output tensor Y = (y (1) ... y (p)) of size m 1 x m 2 x ... x m p by replacing each subtensor with one element, the average of the subtensor:

Here f k is the kernel size of the pooled subtensor for the dimension k and s k is the stride, that is, an interval on which each subtensor is selected; p k is the padding for the dimension k.

The size m 1 x m 2 x ... x m p of the output tensor of the forward 2D pooling layer Y is

For k ∈ {k 1, k 2}, f k cannot be greater than n k .

Problem Statement

To perform average pooling, the problem is to compute the average for each subtensor and apply the transform to the input data:

For more complete information about compiler optimizations, see our Optimization Notice.
Select sticky button color: 
Orange (only for download buttons)