Convolutions and pooling
Not met yet
A convolution slides a small grid of weights, the kernel, over a picture: at each place it fits, multiply by the patch underneath and add. The same kernel is used everywhere, so it finds its pattern wherever it is, and the feature map is smaller than the picture, by the kernel's size less one each way. An edge kernel's weights add up to 0, so it answers only to change. Max pooling keeps the biggest number in each block, so a map shrinks and small shifts matter less. A convolutional network learns its kernels like any other weights.
Try it
main.pyOutput
Press Run and what your program prints shows up here.
Easy to get wrong
- Thinks a convolution gives back a map the same size as the picture, when the kernel has to fit inside, so the map is smaller by the kernel's size less one each way.
- Thinks the kernel is turned round before it's applied, so a right-minus-left kernel finds left-minus-right edges.
- Thinks max pooling averages each block, rather than keeping its biggest number.
- Thinks pooling keeps the rows and columns that don't make a whole block.
- Thinks an edge kernel gives a big answer on any bright patch, when its weights add up to 0 and a patch of one shade gives 0.
- Thinks a convolution uses different weights at each place in the picture, rather than the same kernel everywhere.