283
283
방금 것은 $v$에 대한 Bellman equation이다.
284
284
$q$에 대해서도 Bellman equation이 있다.
285
285
모든 $s\in\mathcal S$와 모든 $a\in\mathcal A$에 대하여 다음 식이 성립한다.
286
- 책에는 이것이 Exercise 3.17로 되어있는 듯하고, 따로 식에 대한 라벨링이 되어 있지않은데 asterisk를 붙여 표시해보려 한다.
286
+ 책에는 이것이 Exercise 3.16로 되어있는 듯하고, 따로 식에 대한 라벨링이 되어 있지 않은데 e3.17로 표시해보려 한다.
287
287
288
288
$$
289
289
\begin{align*}
@@ -294,21 +294,30 @@ q_\pi(s,a)
294
294
&=\sum_{r, s'} p(s', r|s,a)\mathbb E_\pi\left[r+\gamma G_{t+1}|S_{t+1}=s'\right]\\
295
295
&=\sum_{r, s'} p(s', r|s,a)\left(r+\gamma\mathbb E_\pi\left[G_{t+1}|S_{t+1}=s'\right]\right)\\
296
296
&=\sum_{r, s'} p(s', r|s,a)\left(r+\gamma\sum_{a'}\pi(a'|s')\mathbb E_\pi\left[G_{t+1}|S_{t+1}=s', A_{t+1}=a'\right]\right)\\
297
- &=\sum_{r, s'} p(s', r|s,a)\left(r+\gamma\sum_{a'}\pi(a'|s')q_\pi(s',a')\right)\tag{3.14* }
297
+ &=\sum_{r, s'} p(s', r|s,a)\left(r+\gamma\sum_{a'}\pi(a'|s')q_\pi(s',a')\right)\tag{e3.17 }
298
298
\end{align*}
299
299
$$
300
300
301
301
이것은 변수가 $\vert\mathcal S\vert\vert\mathcal A\vert$개이고 식의 개수도 $\vert\mathcal S\vert\vert\mathcal A\vert$개인 연립일차방정식이다.
302
302
303
- <!-- 그런데 증명을 하다보면 현재의 가치는 $v$로 두고 다음 상태의 가치는 $q$로 두고 싶어지고, 또 그 반대인 식도 만들어내고 싶어진다.
304
- 예를 들어 위의 증명을 조금만 바꾸면 다음 두 식이 성립한다.
303
+ 그런데 증명을 하다보면 현재의 가치는 $v$로 두고 다음 상태의 가치는 $q$로 두고 싶어지고, 또 그 반대인 식도 만들어내고 싶어진다.
304
+ 예를 들어 위의 증명을 조금만 바꾸면 다음 두 식이 성립한다 (exercise 3.18, 19) .
305
305
306
306
$$
307
307
\begin{align*}
308
308
v_\pi(s)
309
- &=\sum_a\pi(a|s)\sum_{r,s'}p(r,s'|s,a)\left(r+\gamma\sum_{a'}\pi(a'|s')q_\pi(s',a')\right)\tag{3.14**}\\
309
+ &=\mathbb E_\pi\left[G_t|S_t=s\right]\\
310
+ &=\sum_a\pi(a|s)\mathbb E_\pi\left[G_t|S_t=s,A_t=a\right]\\
311
+ &=\sum_a\pi(a|s)q_\pi(s,a)
312
+ \tag{e3.18}\\
310
313
q_\pi(s,a)
311
- &=\sum_{r, s'} p(s', r|s,a)\left(r+\gamma v_\pi(s')\right]\tag{3.14***}
314
+ &=\mathbb E_\pi\left[G_t|S_t=s, A_t=a\right]\\
315
+ &=\mathbb E_\pi\left[R_{t+1}+\gamma G_{t+1}|S_t=s, A_t=a\right]\\
316
+ &=\sum_{r, s'} p(s', r|s,a)\mathbb E_\pi\left[R_{t+1}+\gamma G_{t+1}|S_t=s,A_t=a, R_{t+1}=r, S_{t+1}=s'\right]\\
317
+ &=\sum_{r, s'} p(s', r|s,a)\mathbb E_\pi\left[r+\gamma G_{t+1}|S_{t+1}=s'\right]\\
318
+ &=\sum_{r, s'} p(s', r|s,a)\left(r+\gamma\mathbb E_\pi\left[G_{t+1}|S_{t+1}=s'\right]\right)\\
319
+ &=\sum_{r, s'} p(s', r|s,a)\left(r+\gamma v_\pi(s')\right)
320
+ \tag{e3.19}
312
321
\end{align*}
313
322
$$ -->
314
323
0 commit comments