Thomas Piacentini
← Workshop

Guided lesson 08 / 10

Learn to decide.

Understand a Q update and separate training, exploration and evaluation.

01 · Understand and consult

The idea before the settings.

A policy selects an action given a state. Q(s,a) estimates expected return after an action followed by the policy. Immediate reward and γ define what is favoured.

During training, ε causes exploratory actions. Evaluation then freezes Q and uses a greedy policy. Comparing methods on matching starts and random events avoids confusing method quality with easier trials.

A worked example.

Q = 1, reward 2, γ = 0.9 and best next Q = 2 give target 3.8. At α = 0.5, the update is 1 + 0.5 × (3.8 − 1) = 2.4.

Read these passages from the authors.

REINFORCEjs · Andrej Karpathy · Reading links open a new tab.

  1. About → Tabular Temporal Difference Learning ↗

    Distinguish dynamic programming with a known model from learning through experience.

  2. GridWorld: TD ↗

    Observe values and policy during learning. Compare exploration and greedy choice; this historical interface differs from the workshop.

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.

Train for 20 episodes. In the table, record success over 32 greedy trials and random/A* baselines.

Open trial A →

No notebook record yet.

Trial B

Change an assumption.

Train for 1,200 episodes with the same seed and parameters. Compare, then repeat with other seeds.

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

The state is an exactly observed cell. The robot learns neither visual perception nor continuous control.

Next guide: Compute attention →

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

atomsh / lab