PPO
Let rt(theta) denote the probability ratio rt(theta)=pitheta(at∣st)/pi(theta"old")(at∣st), so r(theta"old")=1. TRPO maximizes a "surrogate" objective
L"CPI"(theta)=hat(E)t[pitheta(at∣st)/pi(theta"old")(at∣st)hat(A)t]=hat(E)t[rt(theta)hat(A)t].
The superscript CPI refers to conservative policy iteration. Without a constraint, maximization of L"CPI" would lead to an excessively large policy update; hence, we now consider how to modify the objective, to penalize changes to the policy that move rt(theta) away from 1. The main objective proposed is the following:
L"CLIP"(theta)=hat(E)[minrt(theta)hat(A)t,"clip"(rt,1−epsilon,1+epsilon)(theta)hat(A)t]
where epsilon is a hyperparameter. The motivation for this objective is as follows. The first term inside the min is L"CPI". The second term, "clip"(rt(theta),1−epsilon,1+epsilon)hat(A)t, modifies the surrogate objective by clipping the probability ratio, which removes the incentive for moving rt outside of the interval [1−epsilon,1+epsilon]. Finally, we take the minimum of the clipped and unclipped objective, so the final objective is a lower bound (i.e., a pessimistic bound) on the unclipped objective. With this scheme, we only ignore the change in probability ratio when it would make the objective improve, and we include it when it makes the objective worse.
Using a truncated version of generalized advantage estimation(GAE), the advantage estimator is:
hat(A)t=deltat+(gammalambda)delta(t+1)+dots.h.c+(gammalambda)(T−t+1)delta(T−1)
where delta(t)=rt+gammaV(s(t+1))−V(st) is the TD residual.
[!readme]Readme