Thomas Piacentini
← Workshop

14 / 15 · 2–3 h

Deliver in the workshop.

Which strategy delivers a crate despite imprecise actions?

Choose a laboratory
Check my intuition

01 · Predict

Before changing the settings.

Of 20 held-out evaluation deliveries, 18 succeed. What success rate, between 0 and 1, should be reported?

A hint

rate = successes / trials

02 · Experiment and compare

Put the model to the test.

The robot carries a crate at the start and must reach G. Compare A*, the learned Q policy and random actions on the same 32 trials and environment randomness. Vary imprecision, replay several seeds and record failures. The slider steps through the first learned route.

S↓↓×→→→↓→↓↓×↓→→↓→→↓×↓→→↓××↓→↓××↓→↓↓×→↓→↓→→↓×↓↓↓↓→→↓×↓→↓↓→→→→→→→GS: start · G: goal · ×: obstacle · 3: terrain cost□
Arrows: Q policy. Trail: current trial. The small square represents the crate carried by the robot.

32 evaluation episodes without exploration or Q updates, using draws separate from training. Arrows show the greedy policy; the path is the first episode.

Q-learning success
100.00 %
Random success
28.13 %
A* success
100.00 %
Compare A and B →

Read values as a table
MethodHeld-out episodeSuccessMovesReturnCollisions
Q-learning1.001.0014.000.480.00
Q-learning2.001.0013.000.520.00
Q-learning3.001.0012.000.560.00
Q-learning4.001.008.000.720.00
Q-learning5.001.008.000.720.00
Q-learning6.001.007.000.760.00
Q-learning7.001.008.000.720.00
Q-learning8.001.0012.000.561.00
Q-learning9.001.006.000.800.00
Q-learning10.001.001.001.000.00
Q-learning11.001.0013.000.521.00
Q-learning12.001.008.000.720.00
Q-learning13.001.002.000.960.00
Q-learning14.001.0015.000.440.00
Q-learning15.001.001.001.000.00
Q-learning16.001.0018.000.320.00
Q-learning17.001.004.000.880.00
Q-learning18.001.009.000.680.00
Q-learning19.001.003.000.920.00
Q-learning20.001.008.000.720.00
Q-learning21.001.004.000.880.00
Q-learning22.001.0012.000.560.00
Q-learning23.001.003.000.920.00
Q-learning24.001.008.000.720.00
Q-learning25.001.008.000.720.00
Q-learning26.001.009.000.680.00
Q-learning27.001.009.000.680.00
Q-learning28.001.007.000.760.00
Q-learning29.001.008.000.721.00
Q-learning30.001.0017.000.360.00
Q-learning31.001.001.001.000.00
Q-learning32.001.006.000.800.00
A*1.001.0014.000.480.00
A*2.001.0013.000.520.00
A*3.001.0012.000.560.00
A*4.001.009.000.681.00
A*5.001.008.000.720.00
A*6.001.007.000.760.00
A*7.001.008.000.720.00
A*8.001.0012.000.561.00
A*9.001.006.000.800.00
A*10.001.001.001.000.00
A*11.001.0016.000.402.00
A*12.001.008.000.720.00
A*13.001.002.000.960.00
A*14.001.0015.000.440.00
A*15.001.001.001.000.00
A*16.001.0018.000.320.00
A*17.001.004.000.880.00
A*18.001.009.000.680.00
A*19.001.003.000.920.00
A*20.001.008.000.720.00
A*21.001.004.000.880.00
A*22.001.0012.000.560.00
A*23.001.003.000.920.00
A*24.001.008.000.720.00
A*25.001.008.000.720.00
A*26.001.009.000.680.00
A*27.001.009.000.680.00
A*28.001.007.000.760.00
A*29.001.008.000.721.00
A*30.001.0017.000.360.00
A*31.001.001.001.000.00
A*32.001.006.000.800.00
Random1.000.00128.00-5.1238.00
Random2.000.00128.00-5.1237.00
Random3.000.00128.00-5.1238.00
Random4.001.0063.00-1.4815.00
Random5.000.00128.00-7.2832.00
Random6.001.00106.00-6.4823.00
Random7.001.00111.00-3.4021.00
Random8.000.00128.00-5.1235.00
Random9.000.00128.00-5.2036.00
Random10.001.0011.000.600.00
Random11.000.00128.00-5.1236.00
Random12.000.00128.00-6.6434.00
Random13.000.00128.00-8.5624.00
Random14.000.00128.00-5.1245.00
Random15.001.001.001.000.00
Random16.000.00128.00-8.4028.00
Random17.000.00128.00-9.7634.00
Random18.000.00128.00-11.3633.00
Random19.000.00128.00-7.0435.00
Random20.000.00128.00-6.7237.00
Random21.001.00106.00-3.2018.00
Random22.000.00128.00-5.1256.00
Random23.001.0043.00-0.686.00
Random24.000.00128.00-9.9223.00
Random25.000.00128.00-10.0036.00
Random26.001.0083.00-5.3222.00
Random27.000.00128.00-7.6844.00
Random28.000.00128.00-5.1237.00
Random29.000.00128.00-5.1230.00
Random30.000.00128.00-5.1228.00
Random31.000.00128.00-7.9232.00
Random32.001.0018.000.322.00
Understand the calculations

03 · Connect the diagram to calculations

The numbers behind motion.

This synthesis reuses exactly the Q-learning laboratory map, transitions and evaluations. A* knows the map and replans from the current cell; Q is learned by trial and then frozen. Evaluation start cells and environment seeds are identical for all three policies. Also measure length, return and blocked actions, which represent collisions here. Cell observations are exact: the sensor, Kalman filter, continuous dynamics, arm and generative network are not integrated into this discrete scenario. The second mission connects a sensor, Kalman, A* and PID on a planar mobile robot.

success_rate = delivered / trials
path_length = number_of_actions
collisions = blocked_actions
compare: same map, starts, noise seeds, time limit
A few lines to reconstruct
for seed, start in held_out_trials:
    result = rollout(frozen_policy, start, seed, max_steps=128)
    record(result.success, result.steps, result.collisions)

The notebook provides one function per laboratory, hand-calculated examples and tests. Exercises isolate components; these pages run the complete simulations.

Keep an observation

04 · Record

What changed?

Compare two settings. Record the effect, your explanation and a case where the model might fail. Saving keeps the current settings and seed, not a certification of competence.

Open my notebook →

atomsh / lab