机器学习:强化学习

基本概念

常见强化学习算法

基本要素

探索—利用困境(Explore-Exploit dilemma)

times(try)=times(use)+times(explore)\mathrm{times}(try) = \mathrm{times}(use) + \mathrm{times}(explore)

探索和利用是矛盾的,因为尝试次数有限,加强了一方则会自然消弱另一方。

算法中一般使用ϵ=times(explore)times(try)\epsilon=\dfrac{\mathrm{times}(explore)}{\mathrm{times}(try)}ϵgreedy=times(use)times(try)\epsilon\rule[2pt]{1mm}{0.01em}greedy=\dfrac{\mathrm{times}(use)}{\mathrm{times}(try)}来平衡探索和利用。
若初始ϵ\epsilon非常大,则通常让ϵ=1times(try)\epsilon=\dfrac{1}{\sqrt{\mathrm{times}(try)}},即使ϵ\epsilon随着探索次数的增加而减小。

Q-Learning

Flappy Bird

Q-Table

StatesStates Action1Action_1 Action2Action_2 \cdots ActionAction_*
S0S_0 score01score_{01} score02score_{02} \cdots score0score_{0*}
S1S_1 score11score_{11} score12score_{12} \cdots score1score_{1*}
\vdots \vdots \vdots \vdots
SS_* score1score_{*1} score2score_{*2} \cdots scorescore_{**}

Update Q-Table

Q(sas)=(1η)Q(sas)+η[R(sas)+γmaxaQ(sas)]Q(s \xrightarrow{a} s') = (1-\eta) Q(s \xrightarrow{a} s') + \eta \left[ R(s \xrightarrow{a} s') + \gamma \max_{a' } Q(s' \xrightarrow{a' } s'' ) \right]

DQN

Q-Learning使用表格来存储Q(s,a)Q(s,a),但该方法在很多现实问题上是不可行的(状态过多将会导致表格的“维度爆炸”)。

价值函数近似(Value Function Approximation)

该方法就是为了解决状态空间过大的问题,用一个函数来近似表示Q(s,a)Q(s, a)

Q(s,a)=f(s,a,w)Q(s, a) = f(s, a, w)

Policy Gradients

待补充

A3C

待补充