docstr: PPO algorithm
  
  Args:
      model (parl.Model): forward network of actor and critic.
      clip_param (float): epsilon in clipping loss.
      value_loss_coef (float): value function loss coefficient in the optimization objective.
      entropy_coef (float): policy entropy coefficient in the optimization objective.
      initial_lr (float): learning rate.
      eps (float): Adam optimizer epsilon.
      max_grad_norm (float): max gradient norm for gradient clipping.
      use_clipped_value_loss (bool): whether or not to use a clipped loss for the value function.
      norm_adv (bool): whether or not to use advantages normalization.
      continuous_action (bool): whether or not is continuous action environment.
docstr_tok: ["PPO","algorithm","Args",":","model","(","parl.Model",")",":","forward","network","of","actor","and","critic",".","clip_param","(","float",")",":","epsilon","in","clipping","loss",".","value_loss_coef","(","float",")",":","value","function","loss","coefficient","in","the","optimization","objective",".","entropy_coef","(","float",")",":","policy","entropy","coefficient","in","the","optimization","objective",".","initial_lr","(","float",")",":","learning","rate",".","eps","(","float",")",":","Adam","optimizer","epsilon",".","max_grad_norm","(","float",")",":","max","gradient","norm","for","gradient","clipping",".","use_clipped_value_loss","(","bool",")",":","whether","or","not","to","use","a","clipped","loss","for","the","value","function",".","norm_adv","(","bool",")",":","whether","or","not","to","use","advantages","normalization",".","continuous_action","(","bool",")",":","whether","or","not","is","continuous","action","environment","."]
code: def __init__(
      self,
      model,
      clip_param=0.1,
      value_loss_coef=0.5,
      entropy_coef=0.01,
      initial_lr=2.5e-4,
      eps=1e-5,
      max_grad_norm=0.5,
      use_clipped_value_loss=True,
      norm_adv=True,
      continuous_action=False,
  ):
      """PPO algorithm
  
      Args:
          model (parl.Model): forward network of actor and critic.
          clip_param (float): epsilon in clipping loss.
          value_loss_coef (float): value function loss coefficient in the optimization objective.
          entropy_coef (float): policy entropy coefficient in the optimization objective.
          initial_lr (float): learning rate.
          eps (float): Adam optimizer epsilon.
          max_grad_norm (float): max gradient norm for gradient clipping.
          use_clipped_value_loss (bool): whether or not to use a clipped loss for the value function.
          norm_adv (bool): whether or not to use advantages normalization.
          continuous_action (bool): whether or not is continuous action environment.
      """
      # check model methods
      check_model_method(model, "value", self.__class__.__name__)
      check_model_method(model, "policy", self.__class__.__name__)
  
      assert isinstance(clip_param, float)
      assert isinstance(value_loss_coef, float)
      assert isinstance(entropy_coef, float)
      assert isinstance(initial_lr, float)
      assert isinstance(eps, float)
      assert isinstance(max_grad_norm, float)
      assert isinstance(use_clipped_value_loss, bool)
      assert isinstance(norm_adv, bool)
      assert isinstance(continuous_action, bool)
  
      self.clip_param = clip_param
      self.value_loss_coef = value_loss_coef
      self.entropy_coef = entropy_coef
      self.max_grad_norm = max_grad_norm
      self.use_clipped_value_loss = use_clipped_value_loss
      self.norm_adv = norm_adv
      self.continuous_action = continuous_action
  
      self.model = model
      clip = nn.ClipGradByNorm(self.max_grad_norm)
      self.optimizer = optim.Adam(
          parameters=self.model.parameters(),
          learning_rate=initial_lr,
          epsilon=eps,
          grad_clip=clip,
      )
  
file_path: PARL/parl/algorithms/paddle/ppo.py
imports: import parl
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import paddle.optimizer
  from paddle.distribution import Normal, Categorical
  from parl.utils.utils import check_model_method
label_desc: Use image node_id 1 to create a new PPO object from inherited base classes: parl with example: obj = PPO(model, clip_param, value_loss_coef, entropy_coef, initial_lr, eps, max_grad_norm, use_clipped_value_loss, norm_adv, continuous_action)