Pooling aggregates values inside local spatial windows to reduce feature-map dimensions and produce more compact representations. In convolutional networks, it improves computational efficiency while preserving prominent features. section 6.5 section 6.2.3
A max-pooling operation proceeds in four stages:
- Divide the image or feature map into local windows, such as 2 × 2 or 3 × 3 patches. section 6.2.3
- Set the stride to determine how far the window moves between operations; a stride of 2 advances two pixels horizontally and vertically. section 6.2.3
- Select the largest value in each window and use it as that window’s output. section 6.2.3
- Place the reduced feature map in the contracting path, where repeated convolution and pooling blocks capture increasingly abstract features. section 6.2.2
Max pooling in PyTorch
For a 4 × 4 single-channel tensor, torch.nn.MaxPool2d(2) applies a 2 × 2 window with stride 2 and produces [[2, 4], [5, 7]]. section 6.2.3
Figure 6.5 A numerical example of how max pooling works, with a kernel size of 2 × 2 and a stride equal to 2
Inspect the numerical window-by-window calculation behind 2 × 2 max pooling with stride 2. section 6.2.3







