Skip to content

Commit 329a84a

Browse files
committed
merged
2 parents 672634c + e1e6a5e commit 329a84a

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

_posts/2025-08-20-finite_mdp.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ $$
283283
방금 것은 $v$에 대한 Bellman equation이다.
284284
$q$에 대해서도 Bellman equation이 있다.
285285
모든 $s\in\mathcal S$와 모든 $a\in\mathcal A$에 대하여 다음 식이 성립한다.
286-
책에는 이것이 Exercise 3.17로 되어있는 듯하고, 따로 식에 대한 라벨링이 되어 있지않은데 asterisk를 붙여 표시해보려 한다.
286+
책에는 이것이 Exercise 3.16로 되어있는 듯하고, 따로 식에 대한 라벨링이 되어 있지 않은데 e3.17로 표시해보려 한다.
287287

288288
$$
289289
\begin{align*}
@@ -294,21 +294,30 @@ q_\pi(s,a)
294294
&=\sum_{r, s'} p(s', r|s,a)\mathbb E_\pi\left[r+\gamma G_{t+1}|S_{t+1}=s'\right]\\
295295
&=\sum_{r, s'} p(s', r|s,a)\left(r+\gamma\mathbb E_\pi\left[G_{t+1}|S_{t+1}=s'\right]\right)\\
296296
&=\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}
298298
\end{align*}
299299
$$
300300

301301
이것은 변수가 $\vert\mathcal S\vert\vert\mathcal A\vert$개이고 식의 개수도 $\vert\mathcal S\vert\vert\mathcal A\vert$개인 연립일차방정식이다.
302302

303-
<!-- 그런데 증명을 하다보면 현재의 가치는 $v$로 두고 다음 상태의 가치는 $q$로 두고 싶어지고, 또 그 반대인 식도 만들어내고 싶어진다.
304-
예를 들어 위의 증명을 조금만 바꾸면 다음 두 식이 성립한다.
303+
그런데 증명을 하다보면 현재의 가치는 $v$로 두고 다음 상태의 가치는 $q$로 두고 싶어지고, 또 그 반대인 식도 만들어내고 싶어진다.
304+
예를 들어 위의 증명을 조금만 바꾸면 다음 두 식이 성립한다 (exercise 3.18, 19).
305305

306306
$$
307307
\begin{align*}
308308
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}\\
310313
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}
312321
\end{align*}
313322
$$ -->
314323

0 commit comments

Comments
 (0)