Ch 6 ▸ Receptive fields ▸ Module 1/4
One layer.
🔒 This module is locked
It builds on Pool or stride?. Pass that module’s knowledge check to unlock it, or skip ahead if you already know the material.
This chapter needs a word for one value in a layer’s output map. A unit is one value in the output map of any layer. A unit of layer 1 is one output of the first layer; a unit of layer 5 is one value in the fifth layer’s map. The image’s own pixels are the units of the input.
The receptive field of a unit is the set of input pixels whose values can change it. Change a pixel inside the field, and the unit’s value can change. Change a pixel outside it by any amount, and the unit stays exactly the same.
The field size, written , is the width of the receptive field, counted in input pixels. Fields are square in this book, so a field of size spans pixels.
One convolution
A unit of a single 3×3 convolution is a dot product of nine weights with the nine pixels under the kernel. Those nine pixels are its field, and nothing else can affect it. So . A 5×5 kernel gives . With one layer, the field is the patch under the kernel.
From aboveDrag to turn the stack. Click any square to trace it.
From the sideThe row inside the dashed sheet. Point at any unit.
▸ L1 UNIT (15, 15) · r = 3 · JUMP 1 · SEES 3×3 = 9 INPUT PIXELS
Figure 6.1 shows this one layer two ways. In the view from above, the duck lies at the bottom and layer 1’s output map floats over it. The blue square is the unit being traced, and the amber square on the duck is its field. The dashed square marks the field size from the formula. Drag the stack to turn it, and click any square on either map to trace that unit instead.
The view from the side cuts through the stack along the dashed sheet and shows one row of each map. Each line joins one tap to the unit that reads it, so the three lines from the blue unit land on the three pixels it reads in that row.
Kernel size, dilation and stride
Change the kernel size in the listing, and the field changes with it: 1, 3, 5 or 7.
Now set the kernel back to 3 and the dilation to 2. The field size becomes 5, the effective size from chapter 3’s Dilation module: . But the unit still reads only nine pixels. They’re spread across the 5×5 span with a one-pixel gap between them, so the field has holes. In the view from the side, the three lines land on every second pixel. The readout counts the pixels a unit actually reads, 3×3 = 9, while counts the span, 5.
Stride doesn’t change the field of a single layer. Set the stride to 2: the map above the duck shrinks to 16×16, but each unit still reads a 3×3 patch, and stays 3. Stride changes where the kernel stops, not how much it reads at each stop.
At the edge
Click a unit in a corner of layer 1. Part of its 3×3 kernel now lies on the padding around the image. Padding is a fixed 0 that doesn’t depend on any pixel, so it isn’t part of the field. The dashed square still has size 3, but only the 2×2 pixels inside the image are amber. In the view from the side, the taps that land on padding end in dashed boxes outside the row.
Pooling layers follow the same rule. A unit of 2×2 max pooling reads the four pixels of its window, so its field is that window and .
Knowledge check ▸ 5 questions
Before you move on.
Answer every question correctly to unlock the next module. A wrong answer gets a hint, and you can try again as many times as you like.
1What is a unit’s receptive field?
2A single 5×5 convolution at stride 1. What is the field size r of one of its units?
3A single 3×3 convolution at dilation 3. What is r?
4Same layer: a 3×3 convolution at dilation 3. Away from the edges, how many input pixels can actually change one unit?
5A single 3×3 convolution goes from stride 1 to stride 2. What happens to r?