好长时间没跟新了,这期间有好多事情(华为、微博、算法课),现在把最后几节课拾起来。
上节课内容和本节课内容
1)Model-Free和Model-Based的区别:
Model-Free RL: No model Learn value function (and/or policy) from experience
Model-Based RL: Learn a model from experience Plan value function (and/or policy) from model
Model-Based Reinforcement Learning
1)整体流程如下,包括两大部分:model learning、知道model后如何做planning!
Advantages: Can efficiently learn model by supervised learning methods Can reason about model uncertainty Disadvantages: First learn a model, then construct a value function ==> two sources of approximation error
2)到底什么是Model
所谓的model:这里可以理解为agent所在的environment,具体的包括:Pss'以及 Rss'或者Rsa(状态转移情况以及对应的reward,model-free表示不知道这些东西),本质就是MDP。 planning:简单理解是,知道了所有的知识(不一定ground truth),就可以【构造】最优解; learning:简单理解是,不知道某些知识(比如MDP),需要根据experience进行学习;
3)那么如何学习一个Model
具体的办法有很多:
Table Lookup Model(只靠频率去计算状态转移概率与reward值) Linear Expectation Model(每个状态用一些feature去表示(比如打砖块的游戏,当前状态可以用离左右两边的距离、当前的球速等表示),这样学model就是在feature空间做上面提到的regression和density estimation) Linear Gaussian Model Gaussian Process Model Deep Belief Network Model ...
4)以Table Lookup Model的学习为例
记住:只靠频率去计算状态转移概率与reward值
具体的:
5)上面都在说model,下面说有了model之后,如何做planning
所谓的plan、所谓的solve MDP就是指,知道MDP后,如何在每个状态下采取行动,从而最优化收益;
前面的所有课程都在讲这些内容:Value iteration、Policy iteration、Tree search 、。。。
5)planning方法一:sample-based planning
具体的例子:
注意,这里的1是[(0+1)+(0+1)]/2得来的,不是[1+1]/2得来的。 另外,可以考虑结合real experience和sampled experience来估计Value function。(原来后面第三部分就是在讲如何结合这两者)
6)planning的坏处:
最开始就说过,First learn a model, then construct a value function ==> two sources of approximation error 。
实际上,很容易理解,Model-based RL is only as good as the estimated model。
When the model is inaccurate, planning process will compute a suboptimal policy: Solution 1: when model is wrong, use model-free RL Solution 2: reason explicitly about model uncertainty
Integrate Model-Free learning and Model-Based planning
1)出发点
从上面的介绍中可以发现:
所谓model-free的learning,是指只考虑从真实世界中的experience来learning(state/action value function和最优policy)
所谓model-based的planning(using Sample-Based Planning),是指先从真实世界中的experience来learning一个simulated model,再从学到的simulated model中sample experience来learn(这里的learning确切的叫做plan)(state/action value function和最优policy)
总之,上面的很拗口,但我们可能回想,能否把两者结合:
Learn a model from real experience
Learn and planvalue function (and/or policy) from real and simulated experience
2)Dyna
上面的想法叫做Dyna,同时考虑 two sources of experience
具体的architecture:
Dyna-Q Algorithm:
Simulation-Based Search
1)出发点
Forward search paradigm using sample-based planning Simulate episodes of experience from now with the model Apply model-free RL to simulated episodes
2)Monte-Carlo Search例子
2.1)Simple Monte-Carlo Search :
核心思想:从K个episodes的最终的rewards中计算均值
2.2)Monte-Carlo Tree Search (Evaluation) :
核心思想:这里考虑episode经过的所有中间状态u的rewards中计算均值
2.3)Monte-Carlo Tree Search (Simulation) :
2.4)评价
Advantages of MC Tree Search :
Highly selective best-first search Evaluates states dynamically (unlike e.g. DP) Uses sampling to break curse of dimensionality Works for \black-box" models (only requires samples) Computationally efficient, anytime, parallelisable
Temporal-Difference Search : Simulation-based search Using TD instead of MC (bootstrapping) MC tree search applies MC control to sub-MDP from now TD search applies Sarsa to sub-MDP from now MC vs. TD search :