Pooling and receptive fields
Quick answer
Pooling summarizes local regions, often reducing spatial size. A receptive field is the region of original input that may influence a particular output. Stacking layers enlarges the theoretical receptive field. Examples are static Python snippets tested locally on PyTorch CPU. ByteMind execution is unverified.
Signed patch
import torchx=torch.tensor([[[[-4.,-2.],[-3.,-7.]]]])print(torch.nn.MaxPool2d(2)(x).item(),torch.nn.AvgPool2d(2)(x).item())Expected output (locally tested): -2.0 -4.0. Max and mean retain different information.
How it works
Max pooling returns the largest window value; average pooling returns its mean. Neither learns filter weights. MaxPool2d(2) uses stride 2 by default and floor rounding. AdaptiveAvgPool2d(1) returns one spatial value per channel. Track jump J and receptive field R: initially J=R=1; for kernel effective size E and stride S, R_new=R+(E-1)J then J_new=JS. Padding changes alignment and boundary coverage, not nominal size. A 3x3 stride-1 convolution, 2x2 stride-2 pool, then 3x3 stride-1 convolution yields R=8,J=2. Edge support can be smaller and learned effective influence differs from theoretical extent. Pooling sacrifices spatial details and is not perfect translation invariance.
Receptive field and adaptive pool
import torchr=j=1for k,s in [(3,1),(2,2),(3,1)]: r+=(k-1)*j; j*=sprint(r,j)print(list(torch.nn.AdaptiveAvgPool2d(1)(torch.ones(2,5,7,9)).shape))Expected output (locally tested): 8 2 [2, 5, 1, 1]. The nominal field is eight, and pooling keeps five channels.
Common mistakes
Do not confuse feature-map shape with receptive field. On negative inputs, max pooling must not assume zero is the maximum. Excessive downsampling loses small details.
Practice and next steps
Compare max and mean on a signed patch. Trace the receptive field through three layers.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Pooling and receptive fields — knowledge check
Apply pooling and receptive fields to small examples and debugging scenarios.
Does max pooling learn weights?
What does 1x1 adaptive average pooling preserve?
Initial R and J?
Does theoretical field guarantee equal influence?
What may excessive pooling remove?