Math Toolbox · One focused lesson
Change the starting point while keeping the same loss. Watch actual gradient updates reach different valleys.
Reading tips and color key
Start with the explanation and experiment. Open the symbol cards when you want the details. Teal: probabilities; blue: states; orange: actions; green: rewards; purple: values; gray: parameters and settings; crimson: losses and errors. Written labels give every symbol its role.
A slope sees nearby ground, not the whole landscape
Imagine walking downhill in fog. You can feel the slope beside your feet, but another valley may be deeper. Where you start can decide where you finish.
Why study this? A single bowl has one best answer. Many learning objectives have several valleys, flat regions, and saddle points.
How do we investigate? Hold the objective fixed, change the starting point, and inspect actual gradient steps.
What can we conclude? A small slope signals little local first-order change. It does not certify a global minimum.
Symbols for a landscape with two valleys · show / hide
| Symbol | Job | Example |
|---|---|---|
| w, k, α | Real adjustable parameter, nonnegative update count, positive step size; gray settings | w=0.4, α=0.05 |
| f(w), g(w)=f′(w) | Scalar loss and its derivative; crimson | f(0.4)=1.0356; g(0.4)=−1.144 |
Build one update: 0.4 − 0.05 × (−1.144) = 0.4572. The negative slope moves us right. This can approach the right valley even though the left valley is lower.
Try two starting points on the same landscape
Crimson: actual loss. Blue circles: successive parameter settings. No tangent or connecting shortcut is drawn. Displayed numbers are rounded; updates use full precision. Hover or focus a point for its update number.
Show the recorded updates
At most 300 updates. Stops when |gradient|≤0.001, the update budget is reached, or a step leaves the displayed interval [−2,2]. A small gradient is not a global-optimum certificate.
| Step | Old w | Gradient | New w | New loss |
|---|
Build a backward signal, multiplier by multiplier
Start with incoming gradient 1. Each stage multiplies it by the same local derivative c. This is a scalar chain-rule example, not a neural-network training run.
Show every multiplication
| Stage | Incoming | Multiply | Outgoing |
|---|
What can help, and what it cannot promise
Match the response to the difficulty · show / hide
| Situation | Response and reason | Limitation |
|---|---|---|
| Different starting points reach different valleys | Try several initializations; compare the same objective. Restarts explore different attraction regions. | More computation; a finite number of starts cannot generally certify the global best. |
| Slow motion or zigzagging | Momentum accumulates directions: v←βv+g, w←w−αv, with 0≤β<1. Consistent slopes can build speed. | It can overshoot or cross a valley; it is not guaranteed to escape a local minimum. |
| Noisy data already require sampled gradients | SGD noise can sometimes move across shallow barriers; mini-batches balance noise and work. | Noise can also harm progress. Artificially adding noise does not turn this deterministic example into SGD on a dataset. |
| Steps jump across the plot | Reduce the learning rate or use an appropriate step-size search. | Smaller steps improve local control, not knowledge of an unseen better valley. |
A saddle is different from a valley. For F(x,y)=x²−y², the gradient is zero at (0,0). Moving along x raises F; moving along y lowers it. A flat plateau can also slow progress without being a minimum. A tiny gradient alone cannot distinguish these cases.
In an actual ML task, compare candidate models on held-out validation data too. A lower training loss is not automatically better performance on new examples. For deeper context, see the optimization chapter of Deep Learning.
Be First to Comment