強化學習讀書筆記 - 10 - on-policy控制的近似方法
學習筆記:
Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016
參照
- Reinforcement Learning: An Introduction, Richard S. Sutton and Andrew G. Barto c 2014, 2015, 2016
- 強化學習讀書筆記 - 00 - 術語和數學符號
- 強化學習讀書筆記 - 01 - 強化學習的問題
- 強化學習讀書筆記 - 02 - 多臂老O虎O機問題
- 強化學習讀書筆記 - 03 - 有限馬爾科夫決策過程
- 強化學習讀書筆記 - 04 - 動態規划
- 強化學習讀書筆記 - 05 - 蒙特卡洛方法(Monte Carlo Methods)
- 強化學習讀書筆記 - 06~07 - 時序差分學習(Temporal-Difference Learning)
- 強化學習讀書筆記 - 08 - 規划式方法和學習式方法
- 強化學習讀書筆記 - 09 - on-policy預測的近似方法
需要了解強化學習的數學符號,先看看這里:
on-policy控制的近似方法
近似控制方法(Control Methods)是求策略的行動狀態價值\(q_{\pi}(s, a)\)的近似值\(\hat{q}(s, a, \theta)\)。
半梯度遞減的控制Sarsa方法 (Episodic Semi-gradient Sarsa for Control)
Input: a differentiable function \(\hat{q} : \mathcal{S} \times \mathcal{A} \times \mathbb{R}^n \to \mathbb{R}\)
Initialize value-function weights \(\theta \in \mathbb{R}^n\) arbitrarily (e.g., \(\theta = 0\))
Repeat (for each episode):
\(S, A \gets\) initial state and action of episode (e.g., "\(\epsilon\)-greedy)
Repeat (for each step of episode):
Take action \(A\), observe \(R, S'\)
If \(S'\) is terminal:
\(\theta \gets \theta + \alpha [R - \hat{q}(S, A, \theta)] \nabla \hat{q}(S, A, \theta)\)
Go to next episode
Choose \(A'\) as a function of \(\hat{q}(S', \dot \ , \theta)\) (e.g., \(\epsilon\)-greedy)
\(\theta \gets \theta + \alpha [R + \gamma \hat{q}(S', A', \theta) - \hat{q}(S, A, \theta)] \nabla \hat{q}(S, A, \theta)\)
\(S \gets S'\)
\(A \gets A'\)
多步半梯度遞減的控制Sarsa方法 (n-step Semi-gradient Sarsa for Control)
請看原書,不做拗述。
(連續性任務的)平均獎賞
由於打折率(\(\gamma\), the discounting rate)在近似計算中存在一些問題(說是下一章說明問題是什么)。
因此,在連續性任務中引進了平均獎賞(Average Reward)\(\eta(\pi)\):
- 目標回報(= 原獎賞 - 平均獎賞)
- 策略價值
- 策略最優價值
- 時序差分誤差
- 半梯度遞減Sarsa的平均獎賞版
半梯度遞減Sarsa的平均獎賞版(for continuing tasks)
Input: a differentiable function \(\hat{q} : \mathcal{S} \times \mathcal{A} \times \mathbb{R}^n \to \mathbb{R}\)
Parameters: step sizes \(\alpha, \beta > 0\)Initialize value-function weights \(\theta \in \mathbb{R}^n\) arbitrarily (e.g., \(\theta = 0\))
Initialize average reward estimate \(\bar{R}\) arbitrarily (e.g., \(\bar{R} = 0\))
Initialize state \(S\), and action \(A\)Repeat (for each step):
Take action \(A\), observe \(R, S'\)
Choose \(A'\) as a function of \(\hat{q}(S', \dot \ , \theta)\) (e.g., \(\epsilon\)-greedy)
\(\delta \gets R - \bar{R} + \hat{q}(S', A', \theta) - \hat{q}(S, A, \theta)\)
\(\bar{R} \gets \bar{R} + \beta \delta\)
\(\theta \gets \theta + \alpha \delta \nabla \hat{q}(S, A, \theta)\)
\(S \gets S'\)
\(A \gets A'\)
多步半梯度遞減的控制Sarsa方法 - 平均獎賞版(for continuing tasks)
請看原書,不做拗述。