liveBook · Manning

Mean pooling

Mean pooling is a technique that produces one representation by averaging vectors across a sequence or other collection of vectors.

How 2 Manning books explain it

Build AI Drug Discovery Pipelines

Mean pooling forms one representation by averaging the representations of sequence positions.

How it is used
Aggregates atom- or token-level representations into fixed-size molecule- or sequence-level inputs for downstream prediction.
How deep it goes
Explains aggregation choices, batching, masking, normalization, and zero-division protection, but does not derive pooling theory.
Examples
Demonstrates molecular graphs, batched atom features, padded protein sequences, and antibody classification.
What you can do after
Apply it via PyTorch or PyTorch Geometric to create fixed-size representations while excluding padded sequence positions.

Read how Build AI Drug Discovery Pipelines explains mean pooling →

Build an Advanced RAG Application (From Scratch)

Mean pooling forms a sequence representation by averaging the vectors of its elements.

How it is used
Produces fixed-length sentence embeddings for semantic search and similarity matching.
How deep it goes
Explains the aggregation role and pipeline placement, but does not derive token masking or pooling internals.
Examples
Uses six short sentences, a 384-dimensional embedding matrix, and cosine-ranked semantic-search results.
What you can do after
Apply it via Sentence Transformers to convert encoded token sequences into vectors usable for semantic retrieval.

Read how Build an Advanced RAG Application (From Scratch) explains mean pooling →

Related concepts

Questions about mean pooling

What is mean pooling?

Mean pooling is a technique that produces one representation by averaging vectors across a sequence or other collection of vectors.

Which Manning books explain mean pooling?

Build AI Drug Discovery Pipelines and Build an Advanced RAG Application (From Scratch).

What is the difference between mean pooling and max pooling?

Mean pooling is a technique that produces one representation by averaging vectors across a sequence or other collection of vectors. Max pooling is an aggregation operation that represents each group of values by its maximum, often reducing the size of a feature representation.

What is mean pooling a kind of?

Mean pooling is a kind of 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.

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.