Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 15 of 21 in this unit

Build AI Systems · ORIGINAL LEARN AI LESSON

Small errors become different futures.

Compare fresh-state predictions with a model that must live with its own earlier mistakes.

By the end: Evaluate a frozen dynamics model one step at a time and as a free-running rollout, varying horizon, training coverage and target noise while retaining separate state-error units.

Start with the exampleJump to the experimentRead the explanation
Prerequisites and path options

Why learn this? Find out how long a model can predict without fresh observations before using it to imagine actions.

01 · TRY

Start with something concrete.

A navigation estimate is slightly wrong after one turn. If the next estimate starts from that wrong location, it can drift further. If you instead look at a reliable map after each turn, you are testing a different task.

Try the interactive model
02 · PREDICT
Before you experiment

Which input belongs at the second step of a free-running rollout?

Which input belongs at the second step of a free-running rollout?
03 · EXPERIMENT

Change one thing. Watch what follows.

Loading this browser experiment…

04 · UNDERSTAND
READ & CONNECT

Understand what changed.

Back to the experiment

A shorter explanation, with the original worked examples available below. Both explain the same experiment and its limits.

Same learning goal in both modes: Evaluate a frozen dynamics model one step at a time and as a free-running rollout, varying horizon, training coverage and target noise while retaining separate state-error units.

The idea in everyday terms

A model can make a small mistake and then use that mistake as the starting point for its next guess. That is different from receiving the true starting point again each time. The lab compares both ways using the same actions and frozen model.

What to watch in the experiment

Try the untrained model, train it, and compare it with the fitted straight-line baseline. Extend the horizon from ten to sixty intervals. Position error and speed error have different units, so inspect both. The curve may rise, fall or change direction; you cannot obtain its final error simply by multiplying the average one-step error.

Keep the comparisons honest

Coverage and noise change training examples only. The public simulator supplies the reference trajectory; free-running prediction receives only its true initial state. Evaluation never trains the model. These starts and short trajectory prefixes were already visible in earlier practice. A push lasts twenty intervals and is then released; shorter runs use the same prefix.

The graph counts clipped values and the trace keeps exact numbers. A rollout that leaves the computation limits stops explicitly; its partial mean does not stand in for a completed final score. Count model calls separately from simulation and fitting work.

Use the evidence

Record the horizon over which a model remains useful, including a failed run. A simpler model may earn its place. Accurate imagination and successful control are different tests: action selection comes next. Export temporary captures before leaving. Project assessment and human review remain separate; the worked reference gives the exact calculations.

Open the full worked examples, calculations and limitations

This is the same reference used in Technical mode. Expand it whenever you need the exact numbers, assumptions or further explanation.

The next input changes the question

Let state s contain position x in metres and velocity v in metres per second. A frozen predictor takes a state and an applied force u and returns a predicted next state. Frozen means evaluation does not change its fitted parameters.

In one-step evaluation, each prediction starts from a true simulator state. In a free-running rollout, only the initial state is true; each later input is the preceding prediction. The same known action sequence is supplied to both. There is no action selection in this experiment.

one step: s~t+1=fθ(st,ut)free running: s^t+1=fθ(s^t,ut),s^0=s0\text{one step: }\tilde s_{t+1}=f_\theta(s_t,u_t)\qquad\text{free running: }\hat s_{t+1}=f_\theta(\hat s_t,u_t),\quad \hat s_0=s_0

The symbols with a tilde or hat are predictions. A rollout asks whether the model can keep predicting after its own errors change its inputs. A low one-step mean error does not answer that question.

A worked counterexample

Suppose the true position stays at zero and a flawed model always adds 0.1 m to its input position. Fresh-state predictions are always 0.1 m, so each one-step error is 0.1 m. Free-running positions are 0.1, 0.2, 0.3, …, 1.0 m after ten calls. This simple mechanism produces ten times the final error without changing the model.

Other models can damp, reverse or amplify an error. Errors may temporarily cancel, so the error curve need not rise at every interval. A measured average is not a per-state worst-case bound and cannot simply be multiplied by the horizon to obtain a guarantee.

Keep collection, fitting and diagnosis separate

The lab reuses the 0.1-second velocity-first discrete cart plant and the preceding dynamics model: 96 transitions from eight training episodes, a 38-parameter network, a training-fitted affine baseline and persistence. Neural updates use only measured training targets. The affine model fits those same training measurements. Persistence predicts no change.

Choose broad or gentle training actions and exact or perturbed training targets. Changing collection resets neural weights. The target-noise option does not add observations during imagination and does not perturb the reference trajectory. Changing drag changes both the teaching plant and its newly collected training data; changed-dynamics transfer is a later experiment.

The four evaluation starts are the existing public development starts. The first twelve oscillating-force transitions repeat earlier development examples; longer horizons extend that public practice. The alternative applies +2 N for the first twenty intervals and then coasts with zero force. Short horizons use the same prefix, so do not interpret them as a different random experiment.

Read the curves and the missing results

Compare absolute position error with absolute position error, and velocity with velocity. They have different units. The summary reports the mean across valid intervals and the error at the requested final interval. Incomplete runs identify their denominator; a short successful prefix must not silently replace a failed long rollout.

MAE⁡x=1n∑t=1n∣x^t−xt∣,ex(H)=∣x^H−xH∣\operatorname{MAE}_x=\frac{1}{n}\sum_{t=1}^{n}|\hat x_t-x_t|,\qquad e_x(H)=|\hat x_H-x_H|

The plotting scales are fixed: 0–4 m for position error and 0–3 m/s for velocity error. Clipped values are counted and remain in the numerical trace. A proposed state beyond |x| = 20 m or |v| = 10 m/s, or a nonfinite value, stops free-running prediction before accepting it. These are computation limits, not physical safety limits. A stopped rollout has no final-horizon score.

Each fresh-state or free-running prediction is one model call. Rejected proposals count as calls too. Reference simulation, baseline fitting, neural fitting and rendering are different work; the count is not a timing or energy measurement.

Choose evidence for the intended use

Compare models under the same start, force sequence and horizon. A simple affine predictor can beat a poorly fitted neural model. Keep a failed long rollout as evidence about a useful operating horizon. If a controller will observe again after each action, it may tolerate errors differently from a system that imagines for many steps without correction.

This lab establishes neither a useful controller nor an independent evaluation result. The next lesson uses these predictors to select actions. Captures and exports are temporary development records, separate from the lesson check, later project assessment and human implementation review.

05 · APPLY
Check your understanding

One-step mean error is 0.01 m. What is the 40-step rollout error?

One-step mean error is 0.01 m. What is the 40-step rollout error?
06 · CONTINUE

Take this idea with you.

Match evaluation to how a model will be used. Small one-step errors do not establish accurate imagination; compare horizons, state variables and simpler baselines before planning with a model.

My Learning
Explore related topics and the topic map

How this topic connects

Explore this topic on the interactive map

Use these connections to review a foundation or choose where to go next. You can open any topic without completing the others.

What it builds on

You are hereSmall errors become different futures

Compare fresh-state predictions with a model that must live with its own earlier mistakes.

What it enables