Learning, and the capstone · University · about 40 min
Hill climbing on a real machine: a noisy score, a fair trial, and a budget measured in seconds.
[1 mark]This is the lesson's hill climb on a score whose true best value is 23. What does it print?
def score(v):
return abs(v - 23.0) + 2.0
value, step = 0.0, 20.0
best = score(value)
for i in range(8):
trial = value + step
s = score(trial)
if s < best:
value, best = trial, s
else:
step = -step * 0.6
print(round(value, 2), round(best, 2), round(step, 2))[1 mark]Why is a derivative free search the right tool for tuning the lateral offset on the robot?
[1 mark]Each trial starts wherever the previous one ended. What is wrong with the scores?
[1 mark]A method needs 10,000 evaluations and each out and back trial takes 1.6 s of robot time. How many hours is that, to 2 decimal places?
[1 mark]The noise in one trial's score is about as large as the difference between two neighbouring offsets. What is the search doing?
[1 mark]Which statements about exploration and exploitation are right?
Tick every answer that is true.
[1 mark]Feeding flow()[0] back into the lateral command would cancel the leak without learning. What does the learned offset offer that feedback does not?
Hill climb the lateral offset using short out and back trials, plot score as you go, and then drive the robot at least 90 cm up into the green lane.
from bugbot import * connect() DT = 0.1 CMD = 60
Plan your program here, then type it in and press Run.
flow()[0], by taking turns on each. What breaks first, the budget or the noise?