The forward one-dimensional (1D) 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 . 1D average pooling partitions the input tensor data into 1D subtensors by one dimension k, 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 1D pooling layer Y is
f k cannot be greater than n k .
To perform average pooling, the problem is to compute the average for each subtensor and apply the transform to the input data: