Late at night, you press Run on a notebook that trains a small neural network, and this appears on the screen:
Epoch 1/5 iterations: 188/188 train loss: 0.5667 val loss: 0.3928 val accuracy: 0.852
Epoch 2/5 iterations: 188/188 train loss: 0.3171 val loss: 0.2766 val accuracy: 0.892
Epoch 3/5 iterations: 188/188 train loss: 0.2603 val loss: 0.2481 val accuracy: 0.904
Epoch 4/5 iterations: 188/188 train loss: 0.2357 val loss: 0.2259 val accuracy: 0.914
Epoch 5/5 iterations: 188/188 train loss: 0.2187 val loss: 0.2097 val accuracy: 0.921
It looks like a progress report, and it is one. But what is an epoch, and why 188 iterations in each, not 200 or 6,000? What is the "loss" that keeps falling, who pushes it down, and how does a network with thousands of weights know which weight to change, and by how much? The same questions follow a face-recognition model, a spam filter and a translator, and every deep-learning question in a government or bank paper hides behind them.
Earlier lessons gave you the pieces: the neuron and why a network needs a bend between layers (the ict-5 overview), and the slope, the gradient and one step downhill (the maths primer, ai-0). This chapter puts them in motion. You will walk a real model downhill by hand, push a small network through a full training step by hand, and see why deep networks are hard to train and what cures that. Then you will look at what a convolution, an LSTM cell and a pretrained model really compute.