✳ BETWEEN QUESTIONS ML STUDY ATLAS

A QUESTION-LED LESSON

The Chain Rule: How Does a Change Travel Through a Model?

A model is a composition of smaller computations. The chain rule tells us how a change travels through them.

Compose two operations

Let u = 2w and L = u². A change in w affects u, which affects L. The derivative is dL/dw = (dL/du)(du/dw) = 2u × 2 = 4u = 8w.

Check one number

At w = 3, u = 6 and L = 36. The derivatives are dL/du = 12 and du/dw = 2, so dL/dw = 24. A small increase of 0.001 in w predicts an increase of about 0.024 in L; the exact increase also contains a tiny higher-order term. Follow w through the intermediate value u to the loss. The backward derivative is listed beneath the diagram.

INTERACTIVE EXPLORATION

Trace a change through two operations

Change w and compare each local sensitivity. The overall derivative is their product.

Multiple paths

When a value affects an output through several paths, each path contributes and the contributions are added. Backpropagation applies this local bookkeeping efficiently across a computation graph.

Check your understanding

At w = 3, what is dL/dw for L = (2w)²?

24. Multiply the local sensitivities 12 and 2.

Keep exploring

Derivatives ↗Backpropagation ↗

Further reading

Source and further reading ↗