Watch, with pictures and motion, how a network fixes the thickness of its lines (the strength of its connections) little by little while looking at its mistakes against the colors of the points.
With a small network, follow one step at a time, with numbers, the forward pass that computes the output from the input, backpropagation that distributes the gradient of the loss from the output side, and the update that moves the weights along the gradient. Next, change the number of hidden units, the activation function, the learning rate, the minibatch, and the weight decay to observe how training proceeds and the “basis functions that move to fit the data,” and finally check that the backpropagation gradient agrees with the finite-difference approximation.
The network on the left is a calculating machine that answers “red or blue?” from the position of a point (across and up). Press “▶ Learn” and the thickness of the lines changes little by little, and the answer map on the right comes to match the colors of the points.
These are synthetic data for teaching purposes (the positions and colors of the points are made up).
For a single point, a signal flows from left to right and an answer comes out. The gap from the correct answer goes back from right to left, and the thickness of the lines is fixed a little. Use the button to watch one stage at a time.
This is a numerical example for teaching purposes (the starting lines and the input are the same as in Chapter 15, Section 15.3 of the text).
A 2–2–1 network (hidden layer tanh, output sigmoid, cross-entropy loss)
Press “Forward,” “Backward,” and “Update weights” below the figure in order; numbers are added to the figure and the table as you go.
The circles are the input xi, the hidden units hj, and the output. “w” beside a line is the weight (input i → hidden j is W(1)ji; hidden j → output is W(2)j), and “∂L/∂w” is its gradient. Because the bias gradient is ∂L/∂b = δ, only δ is written. Numbers in the figure have 4 significant digits; the table below has 6.
Prediction curve and training data
“Run” advances training. One epoch is the set of updates needed to use every training data point once.
Finite-difference step ε and the difference from the backpropagation gradient
For all parameters, the largest difference between the backpropagation gradient and the finite-difference approximation is plotted as a function of ε.
The description of this simulator (procedure, formulas, conditions, questions) is on the explanation page “Explanation of the Neural Network Simulator”.
Back to Machine Learning — From Probability to GPT (Contents) | Text: Chapter 14, Section 14.5, Chapter 15, Section 15.3 | Equations and explanation (explanation page) | Equations are typeset with the browser’s built-in MathML (no external library).