Make an optimization run repeatable
Record enough state to distinguish a repeated experiment from a similar-looking animation.
Course lessons · 5 of 5
Identify the artifacts needed to reproduce a run and separate trajectory steps from independent repetitions.
Useful background: Understand penalties and tradeoffs
A seed is one part of an experiment
The recovered Rhiannon component initializes parameters with a fixed random seed. A seed can control a random sequence under a particular implementation, but reproducing outputs also requires the source revision, generator, configuration, input data, and execution environment.
Parallel operation order and floating-point behavior can introduce differences across environments. A deterministic teaching lab should reset to a defined state and expose its parameters. A research run should additionally preserve the actual result artifacts and comparison tolerance.
Repeat the unit that supports the claim
One trajectory with one hundred steps is one run, not one hundred independent experiments. Multiple readout batches from one optimized circuit share the trained circuit. Repeating a screenshot or reading a stored record does not add experimental evidence.
In the normalized MIP study, network instances, independent searches, and circuit readout batches have different roles. Keeping those levels distinct prevents a large table from implying more independent evidence than its protocol provides.
Specify a repeatable teaching run
1Pin the starting state
Record the quadratic objective, target three, starting state seven, and step size one half. No random initialization is needed for this example.
2Record the procedure
Take exactly three updates in the stated arithmetic. The states should be five, four, and three and one half.
3Save an inspectable result
Store the parameters, state sequence, objective sequence, source version, and comparison tolerance. Reset should return to seven before a new run.
Make the idea respond
Set starting x = 7, minimum a = 3, and η = 0.5, then step three times. The expected states are 5, 4, and 3.5. Reset the run and repeat with those same settings. This checks a deterministic teaching trajectory; it does not test cross-machine kernel equivalence or reproduce the project’s recorded benchmark.
Change one input at a time. Predict what should happen, then compare the computed result with your prediction.
Teaching model · computed in your browser
Follow the gradient
Choose a starting point and learning rate, then inspect every update toward a quadratic minimum.
a is the location of the minimum; x is the current parameter; η is the learning rate. The derivative is x − a. For this unit-curvature quadratic, an initial error contracts precisely when 0 < η < 2. This condition does not automatically apply to a different loss function.
Try this: keep the same starting point and compare η = 0.5, 1, 2, and 2.5. Watch the distance from the minimum rather than the learning rate alone.
Playback starts only when you choose Play. It pauses when this tab is hidden or the lab leaves view. Reduced-motion preferences slow the updates; Step always gives you direct control. Runs stop after 40 updates or at the display limit.
The default worked example is shown below.
Convergent: each update moves toward the minimum without crossing it. Press Step to compute x₁ = x₀ − η(x₀ − a).
| Update | x | Gradient x − a | Loss ½(x − a)² |
|---|---|---|---|
| 0 | -2 | -5 | 12.5 |
Your turn.
Try an answer before opening a hint. Feedback will explain the result, and you can practice again.
Interactive practice is loading. The lesson, worked example, and printable questions remain available below.
View printable practice and solutions
Use these questions when studying without interactive controls. Opening a written solution does not earn progress.
Starting at 7, targeting 3, with η = 0.5, what state follows three updates?
Read the solution
The errors are four, two, one, and one half, so the third updated state is 3.5.
Which record best supports reproduction?
- The model’s nickname alone.
- Code revision, inputs, configuration, environment, and saved outputs.
- A seed alone.
- A screenshot of a changing counter alone.
Read the solution
The full record identifies what was run and what it produced.
A single optimization trajectory contains 100 steps. How many independent runs does that establish?
- One hundred
- At least a thousand
- None, because any trajectory is invalid
- One
Read the solution
It establishes one run with one hundred dependent updates.
Two machines use the same seed but different numeric kernels. What is the careful expectation?
- Compare outputs under a stated tolerance rather than assume identical bytes.
- Their outputs must be byte-identical.
- Their scientific conclusions must be opposite.
- The seed has no role in any experiment.
Read the solution
The seed helps reproduce initialization, while numeric equivalence still needs verification.
Follow the original record
Use the definitions you just practiced to read the project’s own notation, assumptions, and evidence.
The ideas to keep
- Pin code, data, parameters, and environment.
- Save outputs instead of relying on screenshots.
- Count independent repetitions at the right level.
Reading completion is separate from your practice evidence.
Progress is kept in this browser. How learning works