Part I's chain rule found the slope of one function composed with another. A network is one neuron feeding the next feeding the next — so isn't that just the chain rule, several times over?
This whole curve is , where is itself the output of a first neuron. Drag along it — the tangent line you see is the composed function's real slope, and it's built from nothing but two ordinary sigmoid derivatives.
Exactly Part I's chain rule, applied once per layer:
- — the network's input.
- — the first neuron's output, which feeds into the second neuron as its input.
- — the second neuron's output, the whole composed function's final value.
- — the first neuron's local slope: its own sigmoid derivative times .
- — the second neuron's local slope with respect to its input : its own sigmoid derivative times .
- Each neuron contributes its own local slope
- is the first neuron's local slope — its own sigmoid derivative times .
- is the second neuron's local slope with respect to its input, which happens to be — its sigmoid derivative times .
- Multiply straight through the chain
Multiply the two and you have the slope of the whole chain, with respect to the very first input.
The readout splits the product into its two factors. Neither factor alone is the answer — you need to multiply straight through the chain, exactly the way Part I's chain rule always worked, just with the first function's output value substituted into the second function's slope.
At :
- Compute the first neuron's output and slope
, so and .
- Compute the second neuron's slope, at h
, so .
- Multiply the two slopes together
Matching the tangent line exactly at that point, and matching a plain numerical derivative to five decimal places.
Drag along the curve until its slope reaches -0.353 — the slope at x = 0.5.
A two-layer network's gradient is a two-term product; an -layer network's gradient is an -term product — the exact same chain rule, repeated once per layer. That repeated multiplication, computed efficiently backward through the whole network, is what the next two chapters actually build.