Pooling downsamples a feature map by sliding a small kernel across local patches and replacing each patch with a summary value. This lowers spatial resolution while retaining important features, making convolutional neural networks less sensitive to small shifts, crops, rotations, and distance changes. section 10.7
For a local patch P, max pooling returns max(P), while average pooling returns the arithmetic mean of P. Kernel size and stride determine how many patches are sampled and therefore the output resolution. A 2 × 2 kernel with stride 2 produces a feature map half the input size; a 3 × 3 kernel with stride 3 produces one-third the size. section 10.7
Common pooling roles include:
- Max pooling preserves the strongest activation in each local patch. section 10.7
- Average pooling replaces each patch with its mean, providing local averaging and subsampling. section 10.7 section 11.1
- Pooling reduces feature-map sensitivity to shifts and distortions and supports robustness in convolutional architectures. section 10.8 section 11.1
A 2 × 2 PyTorch pooling step
Represent a feature map as a four-dimensional tensor, then apply torch.nn.MaxPool2d(kernel_size=2, stride=2) or torch.nn.AvgPool2d(kernel_size=2, stride=2). Each operation produces a 2 × 2 output from the supplied 4 × 4 input, summarizing non-overlapping local patches. section 10.7
Figure 10.19 Max pooling using a 2 × 2 kernel with stride 2. The resulting output feature map is half the size of the input feature map. Each value of the output feature map is a max of the corresponding local patch in the input feature map.
Shows how each 2 × 2 input patch contributes its maximum to the downsampled output feature map. section 10.7







