Backpropagation in multilayer networks
◈ 5 cardsThe exam Q9 answer: forward pass → output error → chain-rule blame to hidden weights → gradient-descent update; sigmoid f’ = f(1−f); solves XOR.
Why we need a differentiable neuron
The perceptron’s hard has no usable gradient — the output jumps from to with no sense of how wrong it is. Replace it with the smooth sigmoid (logistic) activation
The derivative is computable from the output alone, which is exactly what makes gradient descent practical. With a hidden layer in between, the network can carve the curved boundaries that a single perceptron cannot — it can solve XOR.
Backpropagation — the exam Q9 answer
Backprop trains a multilayer net by descending the squared-error surface. One pattern, four steps:
- Forward pass. Feed the input forward; each layer computes , layer by layer, to the output.
- Output error. Compare output with the target . The output-node delta is
- the error scaled by the sigmoid slope .
- Backward pass — assign blame by the chain rule. A hidden node has no target of its own. Its responsibility is the weighted sum of the deltas of the output nodes it feeds, scaled by its own slope:
- That is the error propagated backward across the weights — the move that names the algorithm.
- Update every weight by gradient descent, output and hidden alike:
Repeat over the training set for many epochs; the error falls toward a (local) minimum. The exercise trains a 2-2-1 sigmoid net on XOR and prints the error dropping to ~0 with final outputs ≈ .