Lab · c21.s01.L1

Convolution sliding

A convolution reuses one small weighted sum at every position.

Question: Why does looking at neighbours help?

Convolution slidingA row of seven numbered cells holds 0, 0, 5, 5, 5, 0, 0. A three-tap kernel marked 1, 0 and −1 slides along them with the same weights at every stop. Under the window, three products and their sum appear, and five output cells fill in: −5, −5, 0, 5 and 5. The output is zero where the row is flat and large where it changes, so one small weighted sum reads the pattern at every position.Convolution slidingWhy does looking at neighbours help?rowkernelproductssumoutputsone detector's answer at each stop000152535405060123400510−11·0 = 00·0 = 0(−1)·5 = −51·0 + 0·0 + (−1)·5 = −5−5stop 1 of 5window 0, 0, 5
Schematic Schematic: the row and the three-tap kernel are the worked example of section 21.1, and data/scripts/c21.s01.L1.py computes every window, product and output exactly. The lab draws the sliding sum, not a trained network or a measured feature map.
Lab controls
0

Left or Down one stop back, Right or Up one stop forward; Page Down or Page Up two stops, clamped to stop 1 and stop 5; Home is stop 1, End is stop 5. The canvas prints the stop as “stop k of 5”, and changing the stop pauses the slide.

Frame 1 of 6: Stop 1 of 5: window 0, 0, 5The kernel sits on the first window, 0, 0, 5. The products are 1·0 = 0, 0·0 = 0 and (−1)·5 = −5, so the sum is −5. The other 4 output cells are still empty.

Stop 1 of 5: window 0, 0, 5. The kernel sits on the first window, 0, 0, 5. The products are 1·0 = 0, 0·0 = 0 and (−1)·5 = −5, so the sum is −5. The other 4 output cells are still empty.

Keyboard: Space plays or pauses, Left and Right step, Home goes to the first frame, End goes to the last frame.

Text description of this lab

A row of seven numbered cells holds 0, 0, 5, 5, 5, 0, 0. A three-tap kernel marked 1, 0 and −1 slides along them with the same weights at every stop. Under the window, three products and their sum appear, and five output cells fill in: −5, −5, 0, 5 and 5. The output is zero where the row is flat and large where it changes, so one small weighted sum reads the pattern at every position.

Return to the section that hosts this lab

Caption status: schematic. Every lab declares one of published, re-simulated, schematic, synthetic or interpolated.