Learning, and the capstone · University · about 40 min
Why a policy tuned in one world fails in another, and how to report what it does without lying.
[1 mark]A braking policy is run five times with the noise turned up. What does this print for the mean and spread of the gaps it left?
gaps = [31.0, 27.5, 36.2, 29.1, 22.4] mean = sum(gaps) / len(gaps) spread = (sum((g - mean) ** 2 for g in gaps) / len(gaps)) ** 0.5 print(round(mean, 1), round(spread, 1), round(max(abs(g - 30.0) for g in gaps), 1))
[1 mark]A braking threshold tuned with no sensor noise stops the robot too early once noise is added. Why?
[1 mark]A policy is tuned across three noise levels at once instead of one. What is the trade?
[1 mark]Why is the first successful run a biased sample of how well a policy works?
[1 mark]Which are honest ways to report a learned policy?
Tick every answer that is true.
[1 mark]If you can choose only one defence against the reality gap, which does the lesson recommend?
Tune the reading at which the robot starts braking, so that it ends up in the green band, 30 cm from the wall. Plot score as you tune. Then turn the noise up with set_noise(), run the tuned policy three times, and print mean: and spread: of the gaps it left. Put the noise back where it was for the run you hand in.
Start every trial from the same distance, and start it well clear of the threshold you are testing. A trial that begins two centimetres above the braking point triggers on the first unlucky reading and scores nonsense, and the search will believe it.
from bugbot import * connect() DT = 0.1 CRUISE = 85 GAP = 30.0 START_GAP = 55.0
Plan your program here, then type it in and press Run.
set_noise(0) and evaluate at set_noise(3). How much worse is it than tuning with the noise on?