Exercise 3.15 In the gridworld example, rewards are positive for goals, negative for running into the edge of the world, and zero the rest of the time. Are the signs of these rewards important, or only the intervals between them? Prove, using (3.8), that adding a constant ccc to all the rewards adds a constant, vcv_cvc, to the values of all states, and thus does not affect the relative values of any states under any policies. What is vcv_cvc in terms of ccc and γ\gammaγ?
First, for vπv_\pivπ, according to definition:
vπ(s)=Eπ(Gt∣St=s)=Eπ(∑k=0∞γk⋅Rt+k+1∣St=s)
\begin{aligned}
v_\pi(s) &= \mathbb E_\pi(G_t|S_t=s) \\
&= \mathbb E_\pi ( \sum_{k=0}^{\infty} \gamma^k \cdot R_{t+k+1} | S_t = s)
\end{aligned}
vπ(s)=Eπ(Gt∣St=s)=Eπ(k=0∑∞γk⋅Rt+k+1∣St=s)
Denote R^=R+c\hat R = R + cR^=R+c, for R^\hat RR^, there is:
v^π(s)=Eπ(G^t∣St=s)=Eπ(∑k=0∞γk⋅R^t+k+1∣St=s)=Eπ[∑k=0∞γk⋅(Rt+k+1+c)∣St=s]=Eπ(∑k=0∞γk⋅Rt+k+1∣St=s)+Eπ(∑k=0∞γk⋅c∣St=s)=Eπ(∑k=0∞γk⋅Rt+k+1∣St=s)+∑k=0∞γk⋅c=vπ(s)+c1−γ
\begin{aligned}
\hat {v}_\pi(s) &= \mathbb E_\pi(\hat G_t|S_t=s) \\
&= \mathbb E_\pi ( \sum_{k=0}^{\infty} \gamma^k \cdot \hat R_{t+k+1} | S_t = s) \\
&= \mathbb E_\pi \bigl [ \sum_{k=0}^{\infty} \gamma^k \cdot (R_{t+k+1} + c ) | S_t = s \bigr ] \\
&= \mathbb E_\pi ( \sum_{k=0}^{\infty} \gamma^k \cdot R_{t+k+1} | S_t = s) + \mathbb E_\pi(\sum_{k=0}^{\infty} \gamma^k \cdot c | S_t = s)\\
&= \mathbb E_\pi ( \sum_{k=0}^{\infty} \gamma^k \cdot R_{t+k+1} | S_t = s) + \sum_{k=0}^{\infty} \gamma^k \cdot c \\
&= v_\pi(s) + \frac {c}{1 - \gamma} \\
\end{aligned}
v^π(s)=Eπ(G^t∣St=s)=Eπ(k=0∑∞γk⋅R^t+k+1∣St=s)=Eπ[k=0∑∞γk⋅(Rt+k+1+c)∣St=s]=Eπ(k=0∑∞γk⋅Rt+k+1∣St=s)+Eπ(k=0∑∞γk⋅c∣St=s)=Eπ(k=0∑∞γk⋅Rt+k+1∣St=s)+k=0∑∞γk⋅c=vπ(s)+1−γc
∴vc=c1−γ
\therefore v_c = \frac {c}{1-\gamma}
∴vc=1−γc
博客围绕强化学习的网格世界示例展开,探讨奖励正负号及间隔的重要性。通过证明得出,给所有奖励加上常数 c 会使所有状态值加上常数 vc,且不影响任何策略下状态的相对值,并推导出 vc 与 c 和 γ 的关系为 vc = 1 - γc。
1206

被折叠的 条评论
为什么被折叠?



