docstr: Learn policy:
  
  1. Sync parameters of policy model to old policy model
  2. Fix old policy model, and learn policy model multi times
  3. if use KLPEN loss, Adjust kl loss coefficient: beta
docstr_tok: ["Learn","policy",":","1",".","Sync","parameters","of","policy","model","to","old","policy","model","2",".","Fix","old","policy","model",",","and","learn","policy","model","multi","times","3.","if","use","KLPEN","loss",",","Adjust","kl","loss","coefficient",":","beta"]
code: def policy_learn(self, obs, actions, advantages):
      """Learn policy:
  
      1. Sync parameters of policy model to old policy model
      2. Fix old policy model, and learn policy model multi times
      3. if use KLPEN loss, Adjust kl loss coefficient: beta
      """
      self.alg.sync_old_policy()
  
      all_loss, all_kl = [], []
      for _ in range(self.policy_learn_times):
          loss, kl = self._batch_policy_learn(obs, actions, advantages)
          all_loss.append(loss)
          all_kl.append(kl)
  
      if self.loss_type == "KLPEN":
          # Adative KL penalty coefficient
          if kl > self.kl_targ * 2:
              self.beta = 1.5 * self.beta
          elif kl < self.kl_targ / 2:
              self.beta = self.beta / 1.5
  
      return np.mean(all_loss), np.mean(all_kl)
  
file_path: PARL/benchmark/fluid/PPO/mujoco_agent.py
imports: import numpy
  import parl
  from parl import layers
  from paddle import fluid
  from parl.utils import logger
label_desc: Use image node_id 8 for calling the MujocoAgent obj's underlying member method code with example usage: obj.policy_learn(obs, actions, advantages) and returns: np,  np