liveBook · Manning

Feature map

As explained in Learn Generative AI with PyTorch

An intermediate activation map in a neural network whose spatial resolution can be increased or preserved by convolutional operations.

A feature map is the output produced when a convolutional filter scans an image. It records detected spatial patterns and becomes an intermediate representation for later layers. section 4.2.1

A convolution creates a feature map by:

  • Sliding a filter across different image regions while reusing the same weights. section 4.2.1
  • Multiplying corresponding input and filter elements, then summing the results at each position. section 4.2.1
  • Producing one output channel for each learned feature set selected by out_channels. section 4.2.1

A small PyTorch feature map

A 3×3 grayscale tensor passed through a 2×2 convolution with stride 1 and no padding produces a 2×2 feature map. Setting the filter weights to [[1,2],[3,4]] and the bias to 0 yields [[7,14],[54,50]]. section 4.2.1

Figure 4.5 A numerical example of how convolutional operations work, with stride equal to 1 and no padding

Inspect the numerical sliding-window calculation behind the feature-map values. section 4.2.1

How Learn Generative AI with PyTorch covers it

How deep it goes
Explains filter scanning, arithmetic, tensor shapes, and PyTorch parameters, stopping short of deeper network architectures.
Examples
Demonstrates a 3×3 grayscale tensor, a 2×2 filter, fixed weights, and a resulting 2×2 output.
What it assumes
Assumes familiarity with image grids and tensors while introducing channels, kernels, stride, and convolution arithmetic.
What you can do after
Builds a small feature map in PyTorch and verifies its values against manual convolution arithmetic.
How it connects
Connects feature maps with convolutional layers, filters, channels, stride, padding, and image classification.

Also explained in

Compare how 8 books explain feature map →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Generative AI with PyTorch. The section links point to the parts of the book it draws on.