Patches of a picture

You will learn

Why networks read a picture in patches, and what a 2 x 2 window averaged over each patch gives.

A picture is a grid of numbers, and networks read it in small patches so that the same detector works anywhere in it. Here a 2 x 2 window steps by 2 over a 4 x 4 image whose cell i holds i, and each output is the average of its patch: 2.5, 4.5, 10.5 and 12.5. In the backward pass each output's gradient is split equally over its 4 cells. This is average pooling: a convolution would weight the 4 cells with a learned kernel, and its spec, t27#10612, is not merged yet. The spec avgpool2d_layer.t27 computes both passes.

Open the interactive lesson →