Change and uncertainty / 6 of 7
Optimization and objectives
What you’ll learn
- Explain the main idea of “Optimization and objectives” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
Optimization searches for parameters that improve an objective. The objective must reflect the real task: minimizing average error may ignore a rare but costly failure. Constraints such as memory, latency, and fairness affect which solution is useful.
Use small numbers first and work one operation at a time. Track the shape and units of every quantity before doing algebra. The equations here describe idealized objects; implementing them on a computer introduces finite precision and resource constraints. You can understand the mechanism before learning every proof.
Under the hood
Gradient descent updates parameters in the negative gradient direction. A learning rate that is too small is slow; one that is too large can oscillate or diverge. Nonconvex objectives may have multiple stationary points.
Lower training loss does not guarantee better test performance.
A worked example
For L(w)=(w−3)², the gradient is 2(w−3). At w=0 and rate 0.1, the next value is 0.6.
How to use this way of thinking
Check a symbolic result with a numeric example, then consider an edge case such as zero, a very large value, or an incompatible shape. Explain what each symbol means rather than memorizing the equation. If a result surprises you, inspect the assumptions and the units first.
See the mechanism
Start at −3. Take a step at 0.5, then take several steps at 1.1. Compare the loss in the two runs and use the step history to explain the difference.
Opening the experiment…
Try it yourself
Use the experiment to compare rates 0.1 and 1.1 for the quadratic. Explain the trajectories.
Key takeaways
- Divergence or oscillation
- Lower training loss does not guarantee better test performance.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Mathematics for Machine Learning (open textbook) (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.