Pooling, also called downsampling or subsampling, reduces a feature map’s spatial dimensions by aggregating values from local regions. It lets successive convolutions work with a larger effective scope without using oversized kernels. section 8.2.3
Common ways to compute each lower-resolution value include:
- Average pooling computes the mean of each region; it was common early on but is less favored. section 8.2.3
- Max pooling selects the largest value, preserving the strongest response while discarding the other values. section 8.2.3
- A strided convolution calculates outputs at intervals while still incorporating input from the preceding layer. section 8.2.3
A 2 × 2 max-pooling step
Applying max pooling to non-overlapping 2 × 2 tiles replaces each tile with its largest value. A three-channel 32 × 32 input becomes a three-channel 16 × 16 output. section 8.2.3
# In[21]: pool = nn.MaxPool2d(2) output = pool(img.unsqueeze(0)) img.unsqueeze(0).shape, output.shape # Out[21]: (torch.Size([1, 3, 32, 32]), torch.Size([1, 3, 16, 16]))
The PyTorch-style example constructs a 2 × 2 max-pooling layer and shows the resulting tensor shapes. section 8.2.3







