liveBook · Manning

Max pooling

As explained in Natural Language Processing in Action, Second Edition

Max pooling is a downsampling operation that retains the largest activation within each local region of a feature map.

Max pooling compresses many convolution outputs into one value: the largest activation in the region. In a text CNN, that peak acts as evidence that a learned word pattern appeared somewhere in the sequence. section 7.2.1 section 7.5.2

Think of convolution as a stencil moving across data and producing a numerical response at each position. Max pooling keeps the strongest response, so a pattern can be detected without preserving every location where it appeared. This trades positional detail for a compact signal. section 7.2.1 section 7.2.7

Max pooling is useful because it:

  • Aggregates a large tensor into fewer values, reducing the amount of information passed onward. section 7.5.2
  • Measures whether a filter found a strong match somewhere in the input rather than preserving every response. section 7.2.1
  • Differs from mean pooling, which averages values and may better represent patterns distributed across several locations. section 7.2.1 section 7.5.2

Detecting a phrase pattern

A text CNN applies a learned kernel across an ordered word sequence. If one position produces a particularly strong activation, max pooling selects that value as the sequence-level signal that the kernel's pattern was present. section 7.2.1

Figure 7.1 A real-life stencil
figure

Use the stencil figure to visualize a kernel moving across input and producing position-dependent responses before pooling selects the strongest one. section 7.2.1

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains maximum selection, tensor compression, and mean-pooling contrast, but does not detail 2D window or stride configuration.
Examples
Uses ordered word-pattern detection, a moving-stencil analogy, and wave-and-sandcastle imagery to illustrate strongest-response selection.
What it assumes
Assumes familiarity with convolution, kernels, filter outputs, and tensors while explaining pooling from an intuitive starting point.
What you can do after
Evaluate/understand how CNNs convert many filter responses into a compact signal for detecting patterns.
How it connects
Connects max pooling to convolution, kernels, filter outputs, tensor reduction, mean pooling, average pooling, GPUs, and PyTorch.

Also explained in

Compare how 10 books explain max pooling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.