Reinforcement Learning Lab

Eight reinforcement-learning labs: classical, deep, policy optimisation, bandits, planning and multi-agent, with experiments trained for real in your browser.

39interactive experiments

What is reinforcement learning?

RL Fundamentals · basics

Learning objectives

  • Tell RL apart from supervised and unsupervised learning.
  • Identify agent, environment and reward in a new problem.
  • Know why credit assignment is hard.

The idea

In RL the agent is not told the correct answer; it receives a numeric reward after its actions and must discover by trial and error which actions lead to the largest long-run total reward.

Explanation

This differs from supervised learning (ready labelled examples) because the action you choose changes the data you will see next, and because a reward can arrive many steps after the action that caused it.

Equations

G_t = R_{t+1} + \gamma R_{t+2} + \gamma^2 R_{t+3} + \dots = \sum_{k=0}^{\infty} \gamma^k R_{t+k+1}

G_t is the discounted return: the sum of future rewards, weighting distant ones less (γ between 0 and 1).

Worked example

In GridWorld the agent is never told "go right"; it only learns that reaching the goal pays +1 and falling in a pit pays -1. After a few hundred episodes a good path appears in the policy.

Common mistakes

Confusing the reward with the real goal: the reward is a design signal that may not capture what we actually want.

Assuming RL needs little data; it usually needs a lot.

Summary

RL is learning from interaction with a delayed reward signal; the goal is to maximise expected return.

Related experiments

Assessment questions

References

  1. Sutton, R. S.; Barto, A. G. (1998). Reinforcement learning: an introduction (first-edition record; the second edition is free at the author's page). IEEE Transactions on Neural Networks 9(5):1054. doi:10.1109/tnn.1998.712192