Reinforcement learning — practicals

Practicals of the reinforcement-learning course, Master MIND (Sorbonne Université). Each one is a notebook to fill in, in two variants: Notebook is the file to run locally, and Colab the same notebook with a first cell that installs the (pinned) dependencies — download it, then upload it to Google Colab.

To work locally, install uv, and then run

git clone https://git.isir.upmc.fr/mlia/master-mind-rl.git
This will create a master-mind-rl directory. If for some reasons we update the dependencies, you can do latter a
git pull
to update the files without touching your notebooks.

Then download the notebooks you need from the table below into that directory and open them with uv run jupyter lab. The environment does not change from one practical to the next, so this is done once; a notebook fixed during the session is one file to download again.

The notebooks build on rl-mind, a small library installed with the other dependencies: its documentation (a guide, and the reference of every class and method) is online. The archive's README.md also covers tensorboard.

Download

Practicals

#PracticalDescriptionFiles
01Dynamic programmingValue iteration and policy iteration, in a maze
02Tabular reinforcement learningTD learning, Q-learning and SARSA; ε-greedy and softmax exploration
03-1DQN, the bare algorithmDeep Q-learning with neither replay buffer nor target network
03-2DQN, completeA replay buffer, a target network, and the step to Double-DQN
04DDPG and TD3A deterministic actor for continuous actions, then its twin-critic successor
05REINFORCEThe policy gradient and its variants: discounted rewards, learned baselines
06-1A2C, discrete actionsA simple advantage actor-critic
06-2A2C, continuous actionsGaussian policies and Generalized Advantage Estimation
07-1PPO with a KL penaltyStaying close to the old policy by penalising the KL divergence
07-2PPO, clippedThe clipped surrogate objective, on discrete actions
07-3PPO, clipped, continuous actionsThe same algorithm with a Gaussian policy
08Soft Actor-CriticMaximum-entropy off-policy learning: TD3 plus an entropy bonus
09Truncated Quantile CriticsDistributional critics for SAC: quantiles, with the optimistic tail dropped
10Cross-Entropy MethodA black-box optimizer: a population of policies, no gradient and no critic
11Guiding TD3 on a deceptive rewardMountainCar: tutor instructions and behavioural cloning where TD3 fails alone
12Q-learningA Q-table updated by temporal differences, on the MazeMDP environment
13Imitation learning: BC and GAILLearning from demonstrations, without the environment's reward
14Tuning a tabular actor-critic (2024)Grid search, Bayesian optimization with optuna, and a statistical test
14Tabular actor-critic: the critic update rules (2025)V or Q critics, uniform against on-policy sampling: what is off-policy?
15Partial observability: SwimmerThe same temporal-extension wrappers, on a MuJoCo task
15Partial observability: LunarLanderWrappers that hide a feature, then extend the agent in time
A01Environments, actors and collectorsThe infrastructure of the course, and a first tabular Q-learning agent
A02SuperTuxKart: observations and actionsExploring what the pystk2 environments show the agent, and what it can do