Reinforcement Learning

Solve small decision problems, then test what learned policies do when conditions change.

Solve small decision problems, then test what learned policies do when conditions change.

Before you start. Stochastic Modelling for the first eight weeks. Deep Learning helps with the later weeks.

Use Python 3.12 for the examples. Install the dependencies with python -m pip install numpy torch. Run each week as a separate script. Try the worked example on paper first, then change one assumption in the lab and explain the result. All datasets are small or generated locally.

The 12 weeks

WeekLessonWhat you’ll do
1Bandits and explorationMeasure the cost of settling on the first promising option.
2Markov decision processesSpecify a state that makes transitions predictable from the present.
3Returns, values, and Bellman equationsSolve a policy value equation and check it with simulated returns.
4Dynamic programming and value iterationCompute an optimal route using known transitions.
5Monte Carlo prediction and controlEstimate an action value using rewards from complete episodes.
6Temporal-difference learningCompare learning from a one-step target with learning from a complete return.
7SARSA and Q-learningSee how a risky next action changes an on-policy update.
8Linear value function approximationShare information between states using a feature map.
9Deep Q-networksCompare replay and target networks on a small controlled environment.
10Policy gradients and REINFORCEEstimate a policy gradient and reduce its variance with a baseline.
11Actor-critic and PPOTrace a critic estimate into a clipped policy update.
12Capstone · Test a controller under changed conditionsCompare a learned route and a heuristic across seeds, then shift the environment.

Further reading · Sutton and Barto · Reinforcement Learning