Skip to content

Reinforcement Learning — the robot teaches itself

No labels this time. You design the reward; the model tries, fails, and learns — thousands of runs in the simulator.

Design the reward

  1. PhysiCar panel → Racing → Machine Learning → Train → Learning Algorithm Reinforcement.
  2. The reward editor is embedded on the page — reward.py, the one file you write. Return a number every step: higher when driving well (on the line, moving forward), lower or negative when not.
  3. Ask the AI tutor to help — "write me a reward that punishes leaving the line" — it edits this exact file, and the editor picks it up live.

Train (simulator only)

  1. Tick the tracks to train on, set steps, Run.
  2. Watch the reward-per-episode chart climb. Flat chart? Your reward may be too sparse or contradictory — tweak and run again. Training checkpoints continuously, and however a run ends, the model learned so far is saved to the store.

Drive

Same Inference page as supervised learning — the two methods train the same network. Pretrain with your labels, finetune with reinforcement, and compare laps.

Then take it to reality: move your model to the real robot.

Why rewards shape behavior → Learn: reinforcement learning

AI