Forward Propagation, Loss Functions & Backpropagation
Neural Networks & Deep Learning
Chapter 5 · Forward Propagation, Loss Functions & Backpropagation
nn1-3 proved a multi-layer network can solve XOR, using weights a human worked out by hand. historyai3-3 named "1986 backpropagation" as part of AI's own narrated history without ever explaining the mechanism. This chapter delivers both — the real algorithm that finds those weights automatically, for any network, from data alone.
Forward Propagation — Formally Naming What Every Example Already Did
Forward propagation is simply running the network forward: input values flow into the first layer, each neuron computes its weighted sum plus activation, those outputs become the next layer's inputs, and so on until the final output layer produces a prediction. Every worked example since nn1-1 has already done this — this chapter just gives it a name before building on it.
Loss Functions — Cross-Entropy, Classification's Own Counterpart to MSE
ml1-4's own MSE measured regression error. Classification networks typically use a different loss: cross-entropy, which specifically measures how far a predicted probability distribution sits from the true, correct answer.
The Chain Rule — How Blame Travels Backward
A multi-layer network is a chain of functions — one layer's output feeding the next. If a small change to an early-layer weight changes that layer's output, which changes the next layer's output, which changes the final loss, the total effect of that one weight on the final loss is the product of each individual step's own local effect, chained together — precisely the calculus chain rule. Conceptually: if A affects B, and B affects C, then A's own effect on C is A's effect on B, multiplied by B's effect on C.
Backpropagation — The Real Algorithm
This is the real, 1986 breakthrough (Rumelhart, Hinton, and Williams) — a general, automatic method for training a network of any depth, not a hand-derivation limited to one small, already-understood problem like nn1-3's own XOR example. This is the piece Minsky and Papert's own 1969 book (nn1-2) left as an open question, resolved for real seventeen years later.
Gradient Descent — The Actual Update Rule
new_weight = old_weight - learning_rate * gradient
The learning rate controls how large each step is. Too high, and weight updates overshoot, bouncing past good solutions or diverging entirely; too low, and training crawls, taking an impractically long time to converge. nn1-6 covers this, and several real variants of the basic gradient-descent rule, in practical depth.
Closing nn1-3's Own Deferred Promise
nn1-3's own exact OR/NAND decomposition, but a mathematically valid solution reached automatically, with no human ever needing to work out the underlying logical structure by hand. nn1-3's own chapter proved a solution exists; this chapter is what actually finds one.
Hands-On Exercises
Explain, using this chapter's own reasoning, why cross-entropy produces a stronger gradient signal than MSE specifically when a network is confidently wrong, and why that specific situation is exactly when a strong signal matters most.
📄 View solutionUsing this chapter's own A-affects-B-affects-C explanation of the chain rule, explain why computing an early layer's own contribution to the final loss requires information from every layer between it and the output, not just the early layer alone.
📄 View solutionExplain precisely what backpropagation actually resolved that nn1-3's own worked example couldn't, and why "a mathematically valid solution, not necessarily nn1-3's own exact one" is the accurate way to describe what training would find.
📄 View solutionChapter 5 Quick Reference
- Forward propagation — running the network forward to produce a prediction, already used implicitly since nn1-1
- Cross-entropy — classification's own counterpart to ml1-4's MSE, penalizing confident wrong answers much more heavily
- Chain rule — A's effect on C is A's effect on B times B's effect on C, chained across every layer
- Backpropagation — forward pass, compute output-layer gradient, propagate backward via the chain rule, update every weight — the real 1986 breakthrough, delivering historyai3-3's own namecheck
- Gradient descent — new_weight = old_weight − learning_rate × gradient; nn1-6 covers this in practical depth
- Closes nn1-3's own promise: a network can now find valid XOR weights automatically, with no hand-derivation required
- Next chapter: Training in Practice — Regularization for Neural Networks