Proximal policy optimization
Proximal policy optimization (PPO) is a reinforcement learning (RL) algorithm for training an intelligent agent. Specifically, it is a policy gradient method, often used for deep RL when the policy network is very large. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
Proximal policy optimization (PPO) is a reinforcement learning (RL) algorithm for training an intelligent agent. Specifically, it is a policy gradient method, often used for deep RL when the policy network is very large. Input: initial policy parameters \theta_0 , initial value function parameters \phi_0 Hyperparameters: KL-divergence limit \delta , backtracking coefficient \alpha , maximum number of backtracking steps K for k=0,1,2, \ldots do Collect set of trajectories \mathcal{D}_k=\left\{\tau_i\right\} by running policy \pi_k=\pi\left(\theta_k\right) in the environment. Compute rewards-to-go \hat{R}_t . Compute advantage estimates, \hat{A}_t (using any method of advantage estimation) based on the current value function V_{\phi_k} . Estimate policy gradient as \hat{g}_k=\left.\frac{1}{\left|\mathcal{D}_k\right|} \sum_{\tau \in \mathcal{D}_k} \sum_{t=0}^T \nabla_\theta \log \pi_\theta\left(a_t \mid s_t\right)\right|_{\theta_k} \hat{A}_t Use the conjugate gradient algorithm to compute \hat{x}_k \approx \hat{H}_k^{-1} \hat{g}_k where \hat{H}_k is the Hessian of the sample average KL-divergence. Update the policy by backtracking line search with \theta_{k+1}=\theta_k+\alpha^j \sqrt{\frac{2 \delta}{\hat{x}_k^T \hat{H}_k \hat{x}_k}} \hat{x}_k where j \in\{0,1,2, \ldots K\} is the smallest value which improves the sample loss and satisfies the sample KL-divergence constraint. Fit value function by regression on mean-squared error: \phi_{k+1}=\arg \min _\phi \frac{1}{\left|\mathcal{D}_k\right| T} \sum_{\tau \in \mathcal{D}_k} \sum_{t=0}^T\left(V_\phi\left(s_t\right)-\hat{R}_t\right)^2 typically via some gradient descent algorithm. Input: initial policy parameters \theta_0 , initial value function parameters \phi_0 for k=0,1,2, \ldots do Collect set of trajectories \mathcal{D}_k=\left\{\tau_i\right\} by running policy \pi_k=\pi\left(\theta_k\right) in the environment. Compute rewards-to-go \hat{R}_t . Compute advantage estimates, \hat{A}_t (using any method of advantage estimation) based on the current value function V_{\phi_k} . Update the policy by maximizing the PPO-Clip objective: \theta_{k+1}=\arg \max _\theta \frac{1}{\left|\mathcal{D}_k\right| T} \sum_{\tau \in \mathcal{D}_k} \sum_{t=0}^T \min \left(\frac{\pi_\theta\left(a_t \mid s_t\right)}{\pi_{\theta_k}\left(a_t \mid s_t\right)} A^{\pi_{\theta_k}}\left(s_t, a_t\right), \quad g\left(\epsilon, A^{\pi_{\theta_k}}\left(s_t, a_t\right)\right)\right) typically via stochastic gradient ascent with Adam. Fit value function by regression on mean-squared error: \phi_{k+1}=\arg \min _\phi \frac{1}{\left|\mathcal{D}_k\right| T} \sum_{\tau \in \mathcal{D}_k} \sum_{t=0}^T\left(V_\phi\left(s_t\right)-\hat{R}_t\right)^2 typically via some gradient descent algorithm. Like all policy gradient methods, PPO is used for training an RL agent whose actions are determined by a differentiable policy function by gradient ascent. Intuitively, a policy gradient method takes small policy update steps, so the agent can reach higher and higher rewards in expectation. Policy gradient methods may be unstable: A step size that is too big may direct the policy in a suboptimal direction, thus having little possibility of recovery; a step size that is too small lowers the overall efficiency. To solve the instability, PPO implements a clip function that constrains the policy update of an agent from being too large, so that larger step sizes may be used without negatively affecting the gradient ascent process. The advantage function can be defined as A=Q-V , where Q is the discounted sum of rewards (the total weighted reward for the completion of an episode) and V is the baseline estimate. Since the advantage function is calculated after the completion of an episode, the program records the outcome of the episode. Therefore, calculating advantage is essentially an unsupervised learning problem. The baseline estimate comes from the value function that outputs the expected discounted sum of an episode starting from the current state. In the PPO algorithm, the baseline estimate will be noisy (with some variance), as it also uses a neural network, like the policy function itself. With Q and V computed, the advantage function is calculated by subtracting the baseline estimate from the actual discounted return. If A>0 , the actual return of the action is better than the expected return from experience; if A , the actual return is worse.
Cite this
"Proximal policy optimization". 1779396331. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1355448120 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy