Pooling
Pooling is an operation that aggregates values or representations, often summarizing local regions or combining multiple inputs into a smaller or fixed-size representation.
Inside Deep Learning: Math, Algorithms, Models
A neural-network operation that downsamples local neighborhoods by aggregating their values.
- How it is used
- Makes CNN predictions less sensitive to small image shifts before location-sensitive fully connected layers.
- How deep it goes
- Works through max-pooling aliasing and a blur-assisted replacement, while leaving anti-aliased average pooling and strided convolution as exercises.
- Examples
- Tests shifted MNIST digits and downscales a zebra image to expose prediction sensitivity and lost detail.
- What you can do after
- Apply it via PyTorch pooling functions and implement a blur-assisted alternative to test translation sensitivity.
Read how Inside Deep Learning: Math, Algorithms, Models explains pooling →
Natural Language Processing in Action, Second Edition
A pooling layer is a neural-network layer that aggregates neighboring activations to reduce their representation while retaining salient information.
- How it is used
- Compresses convolution responses into fixed-size representations for text classification with CNNs.
- How deep it goes
- Explains aggregation choices and tensor-shape consequences, stopping short of detailed pooling mathematics.
- Examples
- Uses word-based CNNs, disaster tweets, MaxPool1d branches, and an SOS distress-signal exercise.
- What you can do after
- Apply it via PyTorch to reduce convolution outputs before a neural-network classifier.
Read how Natural Language Processing in Action, Second Edition explains pooling →
LLM Evaluation and Alignment, The Foundational Ideas
A pooling layer compresses a sequence of token representations into a fixed-sized representation.
- How it is used
- Compresses token sequences for sentence similarity, passage retrieval, and learned evaluation architectures.
- How deep it goes
- Defines mean, max, and CLS pooling, then works through masking, summation, token counting, and normalization.
- Examples
- Uses paired committee-approval sentences, masked BERT embeddings, cosine similarity, and COMET source-candidate-reference representations.
- What you can do after
- Build fixed-sized text embeddings with mean pooling and compare them using cosine similarity.
Read how LLM Evaluation and Alignment, The Foundational Ideas explains pooling →
Math and Architectures of Deep Learning
A downsampling operation on feature maps that reduces spatial resolution, often by local averaging or max selection.
- How it is used
- Uses local summaries to downsample feature maps and improve convolutional-network robustness to minor input variations.
- How deep it goes
- Defines max and average pooling, explains kernel and stride effects, and bridges the operations to PyTorch implementation.
- Examples
- Uses 2 × 2 max- and average-pooling examples, a 4 × 4 tensor, LeNet subsampling, and global average pooling in GoogLeNet.
- What you can do after
- Apply it via PyTorch using MaxPool2d and AvgPool2d with chosen kernel sizes and strides.
Read how Math and Architectures of Deep Learning explains pooling →
Build a Text-to-Image Generator (from Scratch)
A pooling layer aggregates values within local spatial windows to produce a reduced or transformed feature representation.
- How it is used
- Reduces feature-map dimensions inside U-Net contracting paths and improves computational efficiency while preserving prominent features.
- How deep it goes
- Explains windows, kernels, strides, maxima, and a PyTorch calculation, but does not develop pooling gradients or padding.
- Examples
- Uses a 4 × 4 tensor, 2 × 2 windows, stride 2, and the output [[2, 4], [5, 7]].
- What you can do after
- Apply it via PyTorch’s MaxPool2d layer to downsample image tensors and verify the resulting values.
Read how Build a Text-to-Image Generator (from Scratch) explains pooling →
Evolutionary Deep Learning: Genetic algorithms and neural networks
Pooling is a neural-network operation that aggregates values within local regions to reduce spatial or feature-map dimensions.
- How it is used
- Uses pooling to reduce CNN representations, shrink parameter counts, support generalization, and create latent views in autoencoders.
- How deep it goes
- Demonstrates Keras placement, parameter effects, and architectural experiments but does not derive pooling mathematically.
- Examples
- Uses MaxPooling2D in a CNN and repeated MaxPool2D layers in a Fashion-MNIST convolutional autoencoder.
- What you can do after
- Apply pooling via Keras, inspect its parameter impact, and experiment with pool sizes and surrounding CNN layers.
Read how Evolutionary Deep Learning: Genetic algorithms and neural networks explains pooling →
Graph Neural Networks in Action
A graph operation that reduces a collection of representations to a smaller representation, often for graph-level prediction.
- How it is used
- Uses pooling to reduce learned outputs for graph-level learning while omitting it for node prediction.
- How deep it goes
- Defines pooling and places it in CNN and message-passing pipelines, but does not explain pooling operators or implementation details.
- Examples
- Illustrates pooling through CNN image processing and reduced graph representations for whole-graph prediction.
- What you can do after
- Evaluate whether a graph-learning pipeline needs size reduction for graph-level prediction or should omit pooling for node prediction.
Deep Learning with PyTorch, Second Edition
A downsampling technique that reduces spatial resolution by aggregating local regions of a feature map.
- How it is used
- Uses pooling between convolutions to reduce spatial resolution and expand the network’s effective visual scope.
- How deep it goes
- Defines regional aggregation, compares three downsampling methods, and focuses on non-overlapping 2 × 2 max-pooling tiles.
- Examples
- Uses 2 × 2 tiles, a 32 × 32 tensor reduced to 16 × 16, and a MaxPool2d implementation.
- What you can do after
- Apply it via nn.MaxPool2d to reduce feature-map dimensions between convolutional layers.
Read how Deep Learning with PyTorch, Second Edition explains pooling →
AI-Powered Search
Pooling is the aggregation of multiple representation values into a single lower-level or fixed-size representation.
- How it is used
- Uses pooled sentence vectors to compare semantic similarity in dense-vector search.
- How deep it goes
- Explains token-value aggregation and resulting dimensions, then demonstrates normalization and pairwise scoring without detailing pooling internals.
- Examples
- Compares weather and vehicle phrases, ranks their pairwise similarities, and displays four 768-dimensional embeddings.
- What you can do after
- Apply it via sentence_transformers to encode phrases, normalize vectors, and rank semantic similarities.
Also covered in
- Deep Learning with Python, Third Edition
- Machines that ThinkIn early access (MEAP)
- Data Without Labels
- Fight Fraud with Machine LearningIn early access (MEAP)
- Machine Learning Algorithms in Depth
- Grokking AI Algorithms, Second Edition
- Deep Learning with R, Third Edition
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.
- convolutional neural networkA convolutional neural network is a neural-network architecture that processes structured inputs with convolutional operations, typically using learned local filters to capture patterns.
- 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.
- embeddingAn embedding is a numerical vector representation of an item in a feature space, encoding selected properties or relationships for computational tasks such as comparison or retrieval.
Related concepts
- convolutional neural networkused by · A convolutional neural network is a neural-network architecture that processes structured inputs with convolutional operations, typically using learned local filters to capture patterns.
- mean poolingincludes · Mean pooling is a technique that produces one representation by averaging vectors across a sequence or other collection of vectors.
- max poolingincludes · Max pooling is an aggregation operation that represents each group of values by its maximum, often reducing the size of a feature representation.
- COMETpart of · COMET is a learned metric for evaluating machine-translation quality using multilingual representations and human-quality supervision.
- convolutioncontrasts with · Convolution is an operation that applies a filter or kernel across an input, combining values from local neighborhoods to produce output values.
- downsamplingequivalent to · Downsampling is the reduction of data quantity, spatial resolution, temporal resolution, or sampling rate by retaining, selecting, or aggregating fewer representative values or observations.
Questions about pooling
What is pooling?
Pooling is an operation that aggregates values or representations, often summarizing local regions or combining multiple inputs into a smaller or fixed-size representation.
Which Manning books explain pooling?
Inside Deep Learning: Math, Algorithms, Models, Natural Language Processing in Action, Second Edition, LLM Evaluation and Alignment, The Foundational Ideas, Math and Architectures of Deep Learning, Build a Text-to-Image Generator (from Scratch), Evolutionary Deep Learning: Genetic algorithms and neural networks, Graph Neural Networks in Action, Deep Learning with PyTorch, Second Edition and 1 more.
What should I know before learning pooling?
Manning books that teach pooling usually introduce convolutional layer, convolutional neural network, softmax and embedding first.
What is the difference between pooling and convolution?
Pooling is an operation that aggregates values or representations, often summarizing local regions or combining multiple inputs into a smaller or fixed-size representation. Convolution is an operation that applies a filter or kernel across an input, combining values from local neighborhoods to produce output values.
What kinds of pooling are there?
Kinds of pooling include mean pooling and max pooling.
What is pooling part of?
Pooling is part of COMET. COMET is a learned metric for evaluating machine-translation quality using multilingual representations and human-quality supervision.
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.








