Max pooling
Max pooling is an aggregation operation that represents each group of values by its maximum, often reducing the size of a feature representation.
Math and Architectures of Deep Learning
- How it is used
- Downsamples convolutional feature maps while retaining strong local activations and improving robustness to small feature shifts.
- How deep it goes
- Defines local maximum aggregation and relates kernel size and stride to output resolution, with a PyTorch implementation.
- Examples
- Uses 2 × 2 stride-2 pooling on a 4 × 4 tensor and max-pool layers at the ends of VGG blocks.
- What you can do after
- Apply it via PyTorch MaxPool2d to downsample feature maps and place spatial reductions in convolutional architectures.
Read how Math and Architectures of Deep Learning explains max pooling →
Deep Learning with R, Third Edition
A max-pooling layer down-samples local regions by retaining their maximum values.
- How it is used
- Downsamples feature maps between convolution layers in image classifiers and considers sequence pooling for classification.
- How deep it goes
- Explains window-wise channel maxima and spatial hierarchy, then contrasts architectures with and without pooling.
- Examples
- Uses an MNIST convnet, a no-pooling comparison, and a dogs-versus-cats classifier.
- What you can do after
- Apply it via R Keras layers when constructing image classifiers and tracking feature-map sizes.
Read how Deep Learning with R, Third Edition explains max pooling →
Deep Learning with Python, Third Edition
A two-dimensional pooling layer that downsamples feature maps by taking local maxima.
- How it is used
- Uses max pooling to downsample feature maps between convolution layers in image classifiers.
- How deep it goes
- Explains window maxima, stride, feature-map shapes, and the architectural consequences of omitting pooling.
- Examples
- Compares MNIST classifiers with and without pooling and builds a larger dogs-versus-cats classifier.
- What you can do after
- Apply it via Keras MaxPooling2D when building an image-classification ConvNet.
Read how Deep Learning with Python, Third Edition explains max pooling →
Deep Learning with PyTorch, Second Edition
- How it is used
- Uses max pooling to downsample feature maps between convolutional layers in image classifiers.
- How deep it goes
- Explains 2 × 2 pooling mechanics, feature preservation, discarded values, and alternatives, then demonstrates pooling in convolutional networks.
- Examples
- Illustrates max pooling on a 32 × 32 image, in a bird-versus-airplane classifier, and in a suspected-tumor classifier block.
- What you can do after
- Applies max pooling via PyTorch's nn.MaxPool2d and nn.MaxPool3d in convolutional networks.
Read how Deep Learning with PyTorch, Second Edition explains max pooling →
Inside Deep Learning: Math, Algorithms, Models
- How it is used
- Use max pooling in CNNs to reduce image resolution and make predictions less sensitive to small translations.
- How deep it goes
- Define windows, stride, size reduction, and partial translation invariance, then show CNN placement and the limits of repeated pooling.
- Examples
- Compare K=2 and K=3 windows, shifted MNIST predictions, and two pooling rounds in a CNN.
- What you can do after
- Apply it via PyTorch's nn.MaxPool2d(2) in a CNN and estimate pooling rounds from image dimensions.
Read how Inside Deep Learning: Math, Algorithms, Models explains max pooling →
Build a Text-to-Image Generator (from Scratch)
Max pooling is a spatial downsampling operation that retains the maximum activation within each local window.
- How it is used
- Uses local maxima to downsample feature maps in CNNs, U-Net contracting paths, and image architectures such as ResNet50.
- How deep it goes
- Explains windows, kernel size, stride, numerical output, and PyTorch usage, but does not develop pooling internals.
- Examples
- Demonstrates a 4 × 4 tensor, 2 × 2 windows, stride 2, and the output tensor [[2, 4], [5, 7]].
- What you can do after
- Apply it via PyTorch's nn.MaxPool2d(2) and verify its output on image tensors.
Read how Build a Text-to-Image Generator (from Scratch) explains max pooling →
Graph Neural Networks in Action
max_pool is a PyTorch Geometric pooling function that coarsens a graph by pooling clustered nodes using maximum-valued features.
- How it is used
- Coarsens clustered graphs to reduce their size for analysis and processing.
- How deep it goes
- Shows the two-step clustering-and-pooling procedure and a PyG call, without detailing pooling internals.
- Examples
- Uses a Karate Club graph with before-and-after sizes and a road-network trial that loses important detail.
- What you can do after
- Apply it via PyTorch Geometric's `graclus()` and `max_pool()` to coarsen a graph and assess information loss.
Read how Graph Neural Networks in Action explains max pooling →
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.
- How it is used
- Compresses convolution responses into a strong pattern-presence signal for CNN-based text recognition.
- 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 you can do after
- Evaluate/understand how CNNs convert many filter responses into a compact signal for detecting patterns.
Read how Natural Language Processing in Action, Second Edition explains max pooling →
Evolutionary Deep Learning: Genetic algorithms and neural networks
Max pooling is a neural-network operation that downsamples local activation regions by retaining their maximum values.
- How it is used
- Reduces noisy convolutional feature maps before flattening or passing representations through subsequent neural-network layers.
- How deep it goes
- Explains the reduction purpose and Keras placement, then stops short of deriving pooling mathematically or examining its learned behavior.
- Examples
- Uses Fashion-MNIST CNN layers, model summaries, a max-pooling figure, and automatically generated autoencoder gene sequences.
- What you can do after
- Operate/configure Keras MaxPooling2D layers and inspect their effect on convolutional model dimensions.
Read how Evolutionary Deep Learning: Genetic algorithms and neural networks explains max pooling →
Machine Learning Algorithms in Depth
Max pooling is a downsampling operation that retains the largest value within each local window of a feature sequence.
- How it is used
- Downsamples convolutional feature maps while retaining maximum incoming values in image and sequence models.
- How deep it goes
- Defines maximum aggregation and its architectural role, but does not derive window geometry or pooling gradients.
- Examples
- Uses LeNet for MNIST image classification and a multi-input Quora question-similarity model with 1D convolutions.
- What you can do after
- Apply max pooling via Keras/TensorFlow within image and sequence convolutional architectures.
Read how Machine Learning Algorithms in Depth explains max pooling →
Sutskever's List
A downsampling operation that retains the largest activation within each local spatial window.
- How it is used
- Uses max pooling in AlexNet to reduce feature-map dimensions while retaining strong local activations.
- How deep it goes
- Defines local maximum selection and explains its computational and positional-robustness effects, without detailing pooling variants.
- Examples
- Uses AlexNet’s 3 × 3 windows, stride 2, and progressively reduced spatial dimensions as concrete examples.
- What you can do after
- Understand how max pooling preserves strong local activations while reducing spatial dimensions and computation.
CUDA for LLMs
Max pooling selects the maximum value within each local input region, commonly to reduce spatial resolution.
- How it is used
- Downsamples CNN feature maps, commonly after convolution, to reduce spatial computation and increase tolerance to feature location.
- How deep it goes
- Traces window-wise maxima through CPU loops, CUDA thread mapping, and launch sizing, but stops at reference kernels.
- Examples
- Uses 2 × 2 windows, a stride-1 example on a 3 × 3 input, and a 256 × 256 CUDA launch with pool size 2.
- What you can do after
- Build it from scratch with CPU loops or a CUDA kernel assigning one thread to each output.
What to know first
- convolutional layerA convolutional layer is a neural-network layer that applies shared learned filters to local regions of structured input to produce feature representations.
- softmaxSoftmax is a function that exponentiates each value in a score vector and normalizes the results to produce positive values summing to one, forming a probability distribution.
- feature mapA neural-network feature map is a spatially organized array of activation values representing learned features at different locations or channels.
- linear layerA linear layer is a neural-network layer that applies a learned affine transformation to its input, typically using weights and a bias.
Related concepts
- translation invarianceproduces · Translation invariance is the property that a function, representation, or prediction remains unchanged or equivalent when its input is shifted in position.
- downsamplingkind of · Downsampling is the reduction of data quantity, spatial resolution, temporal resolution, or sampling rate by retaining, selecting, or aggregating fewer representative values or observations.
- poolingkind of · Pooling is an operation that aggregates values or representations, often summarizing local regions or combining multiple inputs into a smaller or fixed-size representation.
- convolutional neural networkpart of · A convolutional neural network is a neural-network architecture that processes structured inputs with convolutional operations, typically using learned local filters to capture patterns.
- strided convolutioncontrasts with · A strided convolution is a convolution whose filter moves across input positions by more than one step, typically reducing spatial or temporal resolution.
Questions about max pooling
What is max pooling?
Max pooling is an aggregation operation that represents each group of values by its maximum, often reducing the size of a feature representation.
Which Manning books explain max pooling?
Math and Architectures of Deep Learning, Deep Learning with R, Third Edition, Deep Learning with Python, Third Edition, Deep Learning with PyTorch, Second Edition, Inside Deep Learning: Math, Algorithms, Models, Build a Text-to-Image Generator (from Scratch), Graph Neural Networks in Action, Natural Language Processing in Action, Second Edition and 4 more.
What should I know before learning max pooling?
Manning books that teach max pooling usually introduce convolutional layer, softmax, feature map and linear layer first.
What is the difference between max pooling and strided convolution?
Max pooling is an aggregation operation that represents each group of values by its maximum, often reducing the size of a feature representation. A strided convolution is a convolution whose filter moves across input positions by more than one step, typically reducing spatial or temporal resolution.
What is max pooling a kind of?
Max pooling is a kind of downsampling. Downsampling is the reduction of data quantity, spatial resolution, temporal resolution, or sampling rate by retaining, selecting, or aggregating fewer representative values or observations.
What is max pooling part of?
Max pooling is part of convolutional neural network. A convolutional neural network is a neural-network architecture that processes structured inputs with convolutional operations, typically using learned local filters to capture patterns.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.











