Thomas Piacentini
← Workshop

Guided lesson 07 / 10

Follow the gradient.

Calibrate gain and offset using gradients and understand the effect of momentum memory.

01 · Understand and consult

The idea before the settings.

The model predicts y = ax + b. A loss measures errors; its gradient describes how loss varies with a and b. Gradient descent subtracts a small multiple of this vector.

Momentum retains part of the previous update. This memory can accelerate a slow direction or cause oscillation. Its effect depends on step size and loss geometry, not just iteration count.

A worked example.

For L(w) = (w − 1)², the gradient at w = 3 is 4. A simple step of size 0.1 gives w′ = 3 − 0.1 × 4 = 2.6.

Read these passages from the authors.

Why Momentum Really Works · Distill · Reading links open a new tab.

  1. First Steps: Gradient Descent → Choosing A Step-size ↗

    Compare small and large step sizes. Identify the connection between curvature and iteration behaviour.

  2. The Dynamics of Momentum ↗

    Explore update memory. Find an oscillating setting and distinguish initial speed from convergence.

If a resource fails to load, local explanations and trials remain available. You can continue and leave reading pending.

02 · Predict

Write before running.

At least 20 characters to document your hypothesis. A wrong prediction is useful: keep it and later explain what surprised you.

03 · Experiment and compare

Two trials, one question.

Each link loads prepared laboratory settings. Seeds match for randomized models. Record results and use “Keep this experiment” for each trial, then return here.

Trial A

Starting comparison.

Set β = 0, step 0.05 and 100 iterations. Record final loss, gain and offset; read the log scale.

Open trial A →

No notebook record yet.

Trial B

Change an assumption.

Change only β to 0.8. Compare parameter trajectories and loss, then try an overly large step.

Open trial B →

No notebook record yet.

Opening a trial replaces this laboratory’s current settings. Saved experiments remain in the notebook. For a controlled comparison, record A and B as given before exploring freely.

04 · Solve

Calculate for yourself.

The laboratory’s numerical challenge checks a small calculation component. Use the hint after trying; this guide helps reconstruct the reasoning.

Solve the laboratory challenge →

Challenge pending.

Continue with the Python notebook ↗

05 · Explain and check

What my trials taught me.

At least 40 characters; cite measurements and one model limitation. Your text is kept in this browser and the notebook JSON export.

My success criteria · self-assessment

Calibration is a small convex regression on noiseless synthetic data, not a large neural network.

Next guide: Learn to decide →

Original ATOMSH guide. Passages and links reviewed on 9 November 2026; external interfaces may change. External courses are not imported in full.

atomsh / lab