Skip to content

Commit

Permalink
fix ch5
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwang067 committed May 25, 2021
1 parent 699cf41 commit 7f5d4ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/chapter5/chapter5.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ A: 在做强化学习的时候,之所以我们考虑的不是参数上的距

**PPO 算法有两个主要的变种:PPO-Penalty 和 PPO-Clip。**

我们来看一下 `PPO1` 的算法,即 `PPO-Penalty`。它先初始化一个 policy 的参数 $\theta^0$。然后在每一个迭代里面呢,你要用参数 $\theta^k$,$\theta^k$ 就是你在前一个训练的迭代得到的 actor 的参数,你用 $\theta^k$ 去跟环境做互动,采样到一大堆状态-动作的对。
我们来看一下 `PPO1` 的算法,即 `PPO-Penalty`。它先初始化一个 policy 的参数 $\theta^0$。然后在每一个迭代里面,你要用参数 $\theta^k$,$\theta^k$ 就是你在前一个训练的迭代得到的 actor 的参数,你用 $\theta^k$ 去跟环境做互动,采样到一大堆状态-动作的对。

然后你根据 $\theta^k$ 互动的结果,估测一下 $A^{\theta^{k}}\left(s_{t}, a_{t}\right)$。然后你就使用 PPO 的优化的公式。但跟原来的 policy gradient 不一样,原来的 policy gradient 只能更新一次参数,更新完以后,你就要重新采样数据。但是现在不用,你拿 $\theta^k$ 去跟环境做互动,采样到这组数据以后,你可以让 $\theta$ 更新很多次,想办法去最大化目标函数。这边 $\theta$ 更新很多次没有关系,因为我们已经有做重要性采样,所以这些经验,这些状态-动作的对是从 $\theta^k$ 采样出来的没有关系。$\theta$ 可以更新很多次,它跟 $\theta^k$ 变得不太一样也没有关系,你还是可以照样训练 $\theta$。

Expand Down

0 comments on commit 7f5d4ea

Please sign in to comment.