Tutorial: Monte Carlo Methods for Model-Free Reinforcement Learning
The fifth installment of a reinforcement-learning tutorial explains Monte Carlo value estimation without an environment model. Using a corridor cleaning-robot example, it covers episodic returns, first-visit averaging, incremental updates, Q-value estimation, Monte Carlo control, and exploration with ε-greedy behavior, and includes Python code.
The tutorial connects complete episodes, Q-value updates, control, exploration, worked examples, and code in one instructional treatment of model-free reinforcement learning.
【上期回顾】 上一篇讲了动态规划:策略评估、策略改进轮流做,就能算出最优策略。可它每一步都要用环境模型,也就是转移概率 ppp 和奖励 rrr。在第 3 篇的算法地图上,它属于左半边:基于环境模型(model-based)。 现实里,模型往往是不知道的:上一篇代码里的 model 函数,智能体其实看不到,只能做个动作、看看结果。 所以从这一篇开始,系列转到地图的右半边:不基于环境模型(model-free)的方法。第 3 篇说过,这是本系列的重头戏,后面会一个个讲。打头的是右半边“基于价值”里的蒙特卡洛方法:不用模型,只靠一个个真的走出来的回合来学。
▲ 图 1 本篇例子:走廊里的扫地机器人(规则同前几篇)