Backpropagation and stochastic updates
Backpropagation applies the chain rule from a loss back to the weights. A stochastic update estimates the full gradient using a sampled example or batch.
What you will learn
- Apply the chain rule
- Compute and apply a sampled gradient
- Check loss and generalization
Work through one complete example
- For prediction y=wx and loss L=½(y−t)², dL/dw=(y−t)x.
- With x=2, w=1, t=5: y=2, error=−3, gradient=−6.
- A step of 0.1 gives wnew=1−0.1(−6)=1.6. The new prediction is 3.2.
- This is one sample update, not a guarantee that every unseen example improves. Multilayer models repeat the chain rule.
Objective 1: Apply the chain rule
- Find dL/dw for y=wx, L=½(y−t)².
- Multiply dL/dy=y−t by dy/dw=x.
Objective 2: Compute and apply a sampled gradient
- Use x=2,w=1,t=5 and α=.1.
- Prediction 2, error −3, gradient −6 give new weight 1.6.
Objective 3: Check loss and generalization
- Find the new loss. Must test performance improve?
- Prediction 3.2 gives loss 1.62 instead of 4.5. Test performance needs separate evaluation.
A common mistake
State the assumptions before using the formula.
Review first
Continue learning
Backpropagation and stochastic updates
Interactive diagnosis and practice load in the learning app. You can read these lesson notes without JavaScript.