What it does
Average pooling outputs the mean of each window, per channel. It smooths rather than selects. Its most common form today is global average pooling at the end of a CNN: every channel of the final feature map is averaged into one number, so an image of any size becomes a fixed-length vector that a dense classifier can read. Mean pooling over token positions does the same for sentence embeddings, where ONNX graphs show it as a ReduceMean.
Formula
Y[c, y, x] = (1 / k2) Σi Σj X[c, s·y + i, s·x + j]global: Y[c] = (1 / HW) Σy,x X[c, y, x]Shapes and parameters
- Shapes
- Input [N, C, H, W]; output [N, C, H', W'], or [N, C, 1, 1] for global pooling. Over tokens: [N, T, D] to [N, D].
- Parameters
- None.
- Used for
- The end of MobileNet, ResNet and SqueezeNet style classifiers, sentence embedding models (mean over tokens), and smoothing inside some detectors.
In WeightSpace
Read-only in WeightSpace today. In the plant classifier and SqueezeNet it produces the vector that the edited classifier biases are added on top of.
Where it appears
- Find text regions on an imagePP-OCRv5 Mobile Detection101.2M params
- Find video shot changesTransNetV237.6M params
- Track motion between two framesRAFT-Small3990K params
- Find rows and cells in a tablePaddleOCR SLANet+21.9M params
- Cut out a portraitMODNet16.5M params
- Identify houseplantsMobileNet V11219K params
- Label a photo with ImageNetSqueezeNet 1.111.2M params
- Recognize sounds in a recordingYAMNet14.0M params
- Track fingertips in a photoMediaPipe Hand Landmarker12.0M params