5.6.9 · D1Machine Learning (Aerospace Applications)

Foundations — Optimization — SGD, momentum, Adam — derivations

2,179 words10 min readBack to topic

Before you can read a single line of the parent derivations, you must be able to read the symbols. This page builds every one of them from nothing — plain words first, then a picture, then why the topic can't live without it. Nothing here is assumed.


0. The landscape picture (the mental image everything hangs on)

Picture a hilly valley. Your horizontal position is your choice of numbers (the "settings" of the model). Your height is how wrong the model is at those settings. Lower = better. Optimization = walking to the bottom of the valley.

Figure — Optimization — SGD, momentum, Adam — derivations

Keep this picture in your head. Every symbol below is a label on some part of it.


1. — the parameters (your position on the ground)

  • Plain words: a bag of dials you are allowed to turn.
  • The picture: the flat ground you walk on (the x-y plane under the hills).
  • Why the topic needs it: the whole goal of training is to find the best , so we need one letter to talk about "all the dials at once."

A single number is written ; when there are many we still write but mean a vector — an ordered list of numbers, like coordinates giving your position in many directions at once.


2. — the loss (your height)

  • Plain words: the "badness score" of your current settings.
  • The picture: the height of the hill directly above where you stand.
  • Why the topic needs it: without a height there is no "downhill." is the surface we are trying to descend.

The notation just means " depends on " — move your feet ( changes), your height () changes.


3. Subscript — the time step (which footstep this is)

  • Plain words: a stopwatch that ticks once per update.
  • The picture: your footprints numbered in the order you made them.
  • Why the topic needs it: every optimizer is a rule that turns into . The subscript lets us write "old → new" cleanly.

4. The slope: derivative, partial derivative, and

This is the heart. To walk downhill you must feel the slope. Three levels of "slope," from simplest to the one the topic uses.

4a. Derivative — slope in ONE direction

  • Plain words: steepness of the ground under one foot.
  • The picture: a straight ramp (tangent line) laid on the curve where you stand — its tilt is the derivative.
Figure — Optimization — SGD, momentum, Adam — derivations

Why this tool and not just "look at the graph"? With a million-dimensional landscape you cannot look. The derivative is a formula that gives the slope numerically, no eyes required. That is why calculus, not eyesight, drives training.

4b. Partial derivative — slope while holding others fixed

  • The picture: stand still, then slide only east-west and measure the tilt; that is one partial.
  • Why needed: each dial has its own slope. We need all of them to know the full downhill direction.

4c. The gradient — all slopes bundled into one arrow

Figure — Optimization — SGD, momentum, Adam — derivations
  • Plain words: the single arrow that says "uphill is that way, and this steep."
  • The picture: an arrow drawn on the ground, pointing up the steepest slope of the hill above you.
  • Why the topic needs it: the very first update rule is . Reading it requires knowing is "the uphill arrow" and the minus sign flips it downhill.

The gradient is computed in practice by Backpropagation and rests on the Taylor Expansion idea that near any point a curved surface looks like a flat ramp.


5. — the learning rate (your step length)

  • Plain words: the size of your stride.
  • The picture: the length of the step-arrow you place on the ground.
  • Why the topic needs it: the gradient gives a direction; turns it into an actual move. Too big → you overshoot the valley and bounce; too small → you crawl. Learning Rate Scheduling is entirely about tuning over time.

6. — the estimated gradient from a mini-batch

  • Plain words: a quick guess of the downhill direction from a few examples.
  • The picture: the true gradient arrow, but wobbling a little because you only glanced at part of the data.
  • Why the topic needs it: real datasets are too big to feel the exact slope every step. is what SGD, Momentum, and Adam actually use. It is unbiased (right on average) but jittery — and that jitter is the whole reason the later optimizers exist.

Here is the loss on one example ; is how many examples are in the batch; means "add them all up."


7. and the exponential moving average — smoothing the past

  • Plain words: a smoothing knob. near = long memory (smooth, slow to react); near = short memory (jumpy).
  • The picture: past gradients fading out, each older one weaker than the last.
Figure — Optimization — SGD, momentum, Adam — derivations
  • Why the topic needs it: the noisy is unreliable step-to-step. Averaging many recent gradients cancels the jitter and reveals the true trend. This EMA is the engine of both Momentum () and Adam (, ). Full detail in Exponential Moving Average.

The "exponential" part: unrolling the recurrence, the gradient from steps ago is weighted by — and shrinks geometrically, so old news fades fast. That is exactly what the picture above shows.


8. Small helper symbols (so nothing surprises you)

  • Why they matter: keeps Adam's division safe; is how we say "on average, over the noise"; the dot product is the number that tells us whether a step goes up or down.

9. Two danger-features of the landscape

  • Why the topic needs them: these two shapes are the villains the whole parent note fights. Noise (SGD) escapes saddles; memory (Momentum/Adam) glides through ravines. More in Saddle Points and Loss Landscapes.

Prerequisite map

theta - position dials

gradient nabla L - downhill arrow

L of theta - height

derivative - slope one way

partial derivative

GD update rule

eta - step length

g sub t - noisy batch gradient

SGD

beta and EMA - smoothing

Momentum

Adam

epsilon and sqrt

saddle points and ravines

Read it as: the plain symbols on top feed the gradient, the gradient plus step size gives the update rule, batching gives SGD, smoothing gives Momentum, and everything together gives Adam.


Equipment checklist

Test yourself — cover the right side.

What does stand for and what part of the landscape picture is it?
The bag of all tunable numbers (weights); it's your horizontal position on the ground.
What does measure and what is it in the picture?
How wrong the model is (loss); it's your height on the hill.
What does the subscript mean?
The step counter — is your position after footsteps.
What is a derivative in one plain sentence?
How fast height changes when you nudge your position a tiny bit, and in which sign.
What does a partial derivative hold fixed?
All dials except the one you're nudging.
What is and which way does it point?
The vector of all partial derivatives; it points toward steepest INCREASE, so is downhill.
What does control?
The step length (learning rate) — how far you move along the chosen direction.
Why is noisy but still usable?
It's the gradient from a small random batch — unbiased (right on average) but jittery.
What does do in an EMA?
Sets the memory: near 1 = long smooth memory, near 0 = short jumpy memory.
Why is in Adam's denominator?
A tiny constant to prevent division by zero.
What does mean here?
The average over the randomness of which mini-batch was drawn.
Why do saddle points break plain gradient descent?
The slope is zero there, so the update stops moving.