HeadlinesBriefing favicon HeadlinesBriefing.com

Backpropagation: The Chain Rule Explained

Towards Data Science •
×

This article, the second part of a series on backpropagation, explains how the chain rule is essential for training neural networks. After reviewing forward propagation and the initial large error observed in Part 1, the focus shifts to efficiently calculating how changes in the network's seven parameters affect the overall loss.

Instead of repeating classical differentiation for each parameter, the article highlights the power of the chain rule. It illustrates this with a simple example (x -> y -> z) and then applies it to the neural network's dependency chain: w1 -> z1 -> a1 -> ŷ -> L. This demonstrates how the effect of changing a parameter like w1 propagates through intermediate computations to impact the final loss.

The article clarifies the distinction between partial derivatives (which indicate which variable is changing) and the chain rule (which shows how effects travel through a computation path). It then begins applying the chain rule step-by-step to the neural network, starting with calculating ∂L/∂ŷ, which represents how the loss changes with a small change in the prediction ŷ.