|
1 | 1 | ---
|
2 | 2 | layout: single
|
3 |
| -title: "(Sutton, 4장) Dynamic Programming" |
| 3 | +title: "(Sutton, 4.1절) Policy Evaluation" |
4 | 4 | categories: machine-learning
|
5 |
| -tags: [reinforcement learing, Bellman optimal equation, partial order] |
| 5 | +tags: [reinforcement learing, Bellman operator, contraction principle, operator norm] |
6 | 6 | use_math: true
|
7 | 7 | published: true
|
8 | 8 | author_profile: false
|
|
144 | 144 |
|
145 | 145 | $$
|
146 | 146 | v_\pi(s)=r_\pi(s)+\gamma\sum_{s'}v_\pi(s')P\left(S_{t+1}=s'|S_t=s\right)
|
| 147 | +\tag{\ast} |
147 | 148 | $$
|
148 | 149 |
|
149 | 150 | 이 된다.
|
150 | 151 | 이전 포스트에도 언급했고, 책의 4장에도 다시 강조되지만 Bellman equation의 본질은 연립방정식, 그것도 선형(affine)연립방정식이다.
|
| 152 | +변수의 개수와 식의 개수가 $|\mathcal S|$로 같으므로 이 연립방정식 $(\ast)$의 해가 단 하나 존재한다고 가정하자. |
151 | 153 | state space $\mathcal S$를 $\mathcal S=\\{s_1,\cdots,s_n\\}$으로 두고 위 식을 다시 쓰면 모든 $i$에 대하여 ($1\le i\le n)$
|
152 | 154 |
|
153 | 155 | $$
|
@@ -287,7 +289,101 @@ $$d(x^\ast,y^\ast)=d\left(\phi(x^\ast),\phi(y^\ast)\right)\le cd(x^\ast,y^\ast)$
|
287 | 289 | 즉 고정점 $x^\ast$는 유일하다.
|
288 | 290 | $\square$
|
289 | 291 |
|
290 |
| -## 4.5 proof (policy evaluation) |
| 292 | +## 4.5 $||P||\le1$ |
291 | 293 |
|
292 |
| -contraction principle을 활용하면 policy evaluation에 대한 증명이 가능하다. |
293 |
| -먼저 Bellman operator $\mathcal T^\pi$는 $\mathbb R^n$에서 $\mathbb R^n$으로 가는 함수인 것을 아까 봤다. |
| 294 | +policy evaluation 증명의 완성을 위해서는 $P$의 operator norm $||P||$가 1보다 작거나 같다는 사실이 필요하다. |
| 295 | +즉 행렬 $P$에 대한 norm은 행렬 $P$를 operator $P:\mathbb R^n\to\mathbb R^n$으로 볼 때의 operator norm을 말한다. |
| 296 | + |
| 297 | +operator norm의 [여러가지 정의](https://en.wikipedia.org/wiki/Operator_norm#Equivalent_definitions) 중 |
| 298 | + |
| 299 | +$$||A||=\sup\{Av:||v||\le1\}$$ |
| 300 | + |
| 301 | +을 사용하자. |
| 302 | +그리고 $||A^T||=||A||$라는 [잘 알려진 사실](https://math.stackexchange.com/a/3471127/746048)을 활용할 수 있다. |
| 303 | +또한, 4.3에서 정의한 행렬 $P$는 각 행의 합이 1이다. |
| 304 | +즉, 모든 $j$에 대하여 $\sum_ip_{ij}=1$이다. |
| 305 | +그러면 |
| 306 | + |
| 307 | +$$ |
| 308 | +\left|\left|p_{1j}v_1+\cdots+p_{nj}v_n\right|\right|_\infty |
| 309 | +\le p_{1j}||v||_\infty+\cdots+p_{nj}||v||_\infty |
| 310 | +=||v||_\infty |
| 311 | +$$ |
| 312 | + |
| 313 | +이므로 |
| 314 | + |
| 315 | +$$ |
| 316 | +\left|\left|P^Tv\right|\right|_\infty |
| 317 | +=\max\{\left|\left|p_{1j}v_1+\cdots+p_{nj}v_n\right|\right|_\infty:j=1,\cdots,n\} |
| 318 | +\le||v||_\infty |
| 319 | +$$ |
| 320 | + |
| 321 | +이고, 따라서 |
| 322 | + |
| 323 | +$$ |
| 324 | +||P|| |
| 325 | +=||P^T|| |
| 326 | +=\sup\{||P^Tv||_\infty:||v||_\infty\le1\} |
| 327 | +\le1 |
| 328 | +$$ |
| 329 | + |
| 330 | +이다. |
| 331 | + |
| 332 | + |
| 333 | +<!-- $$ |
| 334 | +\begin{align*} |
| 335 | +P^Tv |
| 336 | +&=\left( |
| 337 | + ||p_{11}v_1+\cdots+p_{n1}v_n||_\infty, |
| 338 | + \cdots, |
| 339 | + ||p_{1n}v_1+\cdots+p_{nn}v_n||_\infty |
| 340 | + \right)\\ |
| 341 | +&=\left( |
| 342 | + \left|\left| |
| 343 | + p_{11}||v||_\infty+\cdots+p_{n1}||v||_\infty |
| 344 | + \right|\right|_\infty, |
| 345 | + \cdots, |
| 346 | + \left|\left| |
| 347 | + p_{1n}||v||_\infty+\cdots+p_{nn}||v||_\infty |
| 348 | + \right|\right|_\infty |
| 349 | + \right)\\ |
| 350 | +\end{align*} |
| 351 | +$$ |
| 352 | +
|
| 353 | +이므로 |
| 354 | +
|
| 355 | +$$ |
| 356 | +\begin{align*} |
| 357 | +\left|\left|P^Tv\right|\right| |
| 358 | +&= |
| 359 | +\end{align*} |
| 360 | +$$ --> |
| 361 | + |
| 362 | +## 4.6 proof (policy evaluation) |
| 363 | + |
| 364 | +이제 policy evaluation의 가능하다. |
| 365 | +<!-- 먼저 Bellman operator $\mathcal T^\pi$는 $\mathbb R^n$에서 $\mathbb R^n$으로 가는 contraction이다. --> |
| 366 | +두 벡터 $v,w\in\mathbb R^n$에 대하여 |
| 367 | + |
| 368 | +$$ |
| 369 | +\begin{align*} |
| 370 | +\left|\left|T^\pi(v) - T^\pi(w)\right|\right|_\infty |
| 371 | +&=\gamma\left|\left|P(v-w)\right|\right|_\infty\\ |
| 372 | +&=\gamma||v-w||_\infty\\ |
| 373 | +\end{align*} |
| 374 | +$$ |
| 375 | + |
| 376 | +이다. |
| 377 | +만약 $0\lt\gamma\lt1$ 이면 $\mathcal T^\pi$는 $\mathbb R^n$에서 $\mathbb R^n$으로 가는 contraction이다. |
| 378 | +그러면 contraction principle에 의해 |
| 379 | + |
| 380 | +$$\mathcal T^\pi(v^\ast)=v^\ast$$ |
| 381 | + |
| 382 | +인 $v^\ast\in\mathbb R^n$이 유일하게 하나 존재한다. |
| 383 | +Bellman equation $(\ast)$도 유일한 해 $v_\pi$를 가지므로 이 두 벡터는 같다. |
| 384 | +즉, policy evaluation을 통해 얻게되는 가치함수는 $v_\pi$이다. |
| 385 | +다시 말해 |
| 386 | + |
| 387 | +$\lim_{k\to\infty}v_k=v_\pi$ |
| 388 | + |
| 389 | +가 성립한다. |
0 commit comments