Chapter 1
Why not a dense layer?.
The obvious way to show an image to a neural network is to unroll it into one long list of numbers. This chapter shows what that costs.
A neural network is built from layers, and the simplest kind of layer takes a list of numbers and computes a new list from it. An image is a grid, not a list, but you can turn it into one by reading off the pixels row by row.
We’ll do that here and hand the list to the simplest layer there is, the dense layer. It works. It also has two problems. It’s enormous, because the number of weights is the number of pixels times the number of outputs, which for an ordinary photo runs into the billions. And it can’t tell which pixels were next to each other. Shuffle every image’s pixels the same way and the layer learns from the scrambled images just as well as from the real ones, which says it was never using the picture as a picture.
Convolutions fix both, and they’re what the rest of the book is about. The figures use a small drawing of a duck on a pond, 16 pixels on a side.
Modules
Each module ends in a short knowledge check. Passing it unlocks the next module. Your progress is saved in this browser.