Deep learning¶
The learning machinery behind both racing teachers is a neural network — layers of simple weighted sums, stacked until they can represent very complex functions.
Neurons to networks¶
- A neuron multiplies inputs by weights, sums, and passes the result through a simple non-linearity.
- A layer is many neurons in parallel; a deep network is many layers in series. Depth is what lets simple pieces compose into "recognize a curve".
- Training = adjusting all the weights at once, a tiny step at a time, in the direction that reduces error (gradient descent). Supervised and reinforcement learning differ only in where the error signal comes from.
CNNs — networks that see¶
Images are huge, and a pattern (an edge, the line) can appear anywhere. A convolutional network slides small filters across the image, so the same pattern detector works at every position. Early layers find edges; deeper layers combine them into shapes; the final layers turn shapes into a decision — your steering.
The racing model is exactly this: camera frame in → convolutions → steering out. Both teachers train the same CNN, which is why you can pretrain supervised and finetune with reinforcement.
Practical intuitions¶
- More data beats a fancier network, almost always.
- If training loss falls but driving stays bad, the data (not the network) is the suspect — see supervised learning.
- Models don't "understand" the track; they map pixels to actions. Change the pixels (lighting, line color) and the map degrades — that's the Sim2Real gap.