其他分享
首页 > 其他分享> > 机器学习 | 强化学习(5) | 价值函数拟合(Value Function Approximation)

机器学习 | 强化学习(5) | 价值函数拟合(Value Function Approximation)

作者:互联网

价值函数拟合(Value Function Approximation)

导论(Introduction)

价值函数近似的类型

这里的\(\theta\)指的是一个函数近似的模型(不管是神经网络还是啥),或者说这里看成一个黑箱

\[s \rightarrow \theta(\mathbf w) \rightarrow \hat v(s,\mathbf w) \]

\[s,a \rightarrow \theta(\mathbf w) \rightarrow \hat q(s, a,\mathbf w) \]

\[s \rightarrow \theta(\mathbf w) \rightarrow \hat q(s, a_1,\mathbf w)\cdots \hat q(s, a_m,\mathbf w) \]

该如何选择函数近似模型呢?

这里有着多多少少的函数近似模型

我们一般采用可微分的(differentiable)函数近似模型

例如:

更多方面,我们需要一种可以适用于非静态以及的非IID数据的训练方法

注:非IID(Non-independent and identical distributed)非独立或是同质分布,这里我抄一下定义:

Literally, non iid should be the opposite of iid in either way, independent or identical.

顾名思义,non-iid即是独立 或者 同质分布(iid)的反义词。

So for example, if a coin is flipped, let X is the random variable of event that result is tail, Y is the random variable of event the result is head, then X and Y are definitely dependent. They can be decided by each other.

我们举一个例子,想象抛出一枚硬币,x是最后一次抛出的结果分布,而y是第一次抛出的结果分布,若xy之间存在一定的相关性。那么他们之间存在决定关系。

As to the non identical, once the distributions of two random variables are not the same, they can be called non-identical.

对于非同质性,如果一个分布里面的任意两个变量都是不一致的,那么就称为非同质的

Therefore, either of the situations happen, you may get an example of non iid case.

为此,存在上述一种情况,那么就是non-iid数据

提升性方法(Incremental Methods)

梯度下降(Gradient Descent)

基于随机梯度下降(Stochastic Gradient Descent)的价值函数拟合

特征向量(Feature Vectors)

线性价值函数近似(Linear Value Function Approximation)

查表式特征(Table Lookup Features)

增长型的预测算法(Incremental Prediction Algorithm)

基于蒙特卡罗的价值函数估计

基于时序差分的价值函数估计

基于\(TD(\lambda)\)的价值函数估计

对于Forward View和Backward View的线性\(TD(\lambda)\)都是等价的

这时候有学生提问Silver道为何更新的时候只用\(\hat v(S,\mathbf w)\),而不用所有\(\lambda\)的价值函数,Silver解释道因为每次更新都会用到Forward的数据,而这些Forward的数据基于一大堆真实reward,其置信度较高,如果在后续更新一个未知的价值函数再更新一次只会对这些价值函数产生倒退的作用;另外实践中证明的确是前者方法更高效。

动作-价值函数的估计

线性动作-价值函数(Linear Action-Value Function)的估计

增长型的控制算法

预测算法的收敛性

这里Silver提出了一个反例并不是所有情况下都适用用\(TD\)学习,有时候并不一定会收敛

基于策略与否 算法 查表 线性 非线性
基于策略 蒙特卡罗 \(\checkmark\) \(\checkmark\) \(\checkmark\)
\(TD(0)\) \(\checkmark\) \(\checkmark\) \(\times\)
\(TD(\lambda)\) \(\checkmark\) \(\checkmark\) \(\times\)
非基于策略 蒙特卡罗 \(\checkmark\) \(\checkmark\) \(\checkmark\)
\(TD(0)\) \(\checkmark\) \(\times\) \(\times\)
\(TD(\lambda)\) \(\checkmark\) \(\times\) \(\times\)

梯度时序差分学习(Gradient Temporal-Diference Leanrning)

基于策略与否 算法 查表 线性 非线性
基于策略 蒙特卡罗 \(\checkmark\) \(\checkmark\) \(\checkmark\)
\(TD\) \(\checkmark\) \(\checkmark\) \(\times\)
梯度\(TD\) \(\checkmark\) \(\checkmark\) \(\checkmark\)
非基于策略 蒙特卡罗 \(\checkmark\) \(\checkmark\) \(\checkmark\)
\(TD\) \(\checkmark\) \(\times\) \(\times\)
梯度\(TD\) \(\checkmark\) \(\checkmark\) \(\checkmark\)

控制算法的收敛性

算法 查表法 线性 非线性
蒙特卡罗控制 \(\checkmark\) (\(\checkmark\)) \(\times\)
\(SARSA\)控制 \(\checkmark\) (\(\checkmark\)) \(\times\)
Q-学习 \(\checkmark\) \(\times\) \(\times\)
梯度Q-学习 \(\checkmark\) \(\checkmark\) \(\times\)

带括号表示会在接近最优解旁边环绕

批量方法(Batch Methods)

批量强化学习(Batch Reinforcement Learning)

最小二乘预测(Least Squares Prediction)

基于记录回放(Experience Replay)的随机梯度下降(SGD)

基于记录回放的深度Q网络(Deep Q-Network, DQN)

DQN采用纪录回放以及拟合Q目标

[后面都是讲DQN应用于雅达利游戏的例子,就没记录了]

线性最小二乘法预测(Linear Least Squares Prediction)

对于\(LS(\mathbf w)\)中的最小值,其期望的更新应该为0

\[\begin{align} \mathbb{E}_\mathcal{D}[\Delta\mathbf]&=0 \\ \alpha\sum^T_{t=1}\mathbf x(s_t)(v^\pi_t -\mathbf x(s_t)^T\mathbf w) & = 0 \\ \sum^T_{t=1}\mathbf x(s_t)v^\pi_t & =\sum^T_{t=1}\mathbf x(s_t) \mathbf x(s_t)^T\mathbf w \\ \mathbf w & =\Bigg(\sum^T_{t=1}\mathbf x(s_t) \mathbf x(s_t)^T \Bigg) ^ {-1}\sum^T_{t=1}\mathbf x(s_t)v^\pi_t \end{align} \]

线性最小二乘法预测

最小平方动作-状态函数拟合(Least Squares Action-Value Function Approximation)

\[\mathcal{D} = \{\langle (s_1,a_1),v_1^\pi\rangle,\langle (s_2,a_2),v_2^\pi\rangle,\dots,\langle (s_T,a_T),v_T^\pi\rangle\} \]

最小二乘控制(Least Squares Control)

最小二乘Q-Learning

各类控制算法的收敛性

算法 查表法 线性 非线性
蒙特卡罗控制 \(\checkmark\) (\(\checkmark\)) \(\times\)
SARSA \(\checkmark\) (\(\checkmark\)) \(\times\)
Q-Learning \(\checkmark\) \(\times\) \(\times\)
LSPI \(\checkmark\) (\(\checkmark\)) -

带括号的意味着会在最优解附近徘徊

标签:Function,mathbf,checkmark,Value,Approximation,alpha,pi,hat,align
来源: https://www.cnblogs.com/uzuki/p/14289944.html