docstr: PPO algorithm
  
  Args:
      model (parl.Model): model defining forward network of policy and value.
      act_dim (float): dimension of the action space.
      policy_lr (float): learning rate of the policy model. 
      value_lr (float): learning rate of the value model.
      epsilon (float): epsilon used in the CLIP loss (default 0.2).
docstr_tok: ["PPO","algorithm","Args",":","model","(","parl.Model",")",":","model","defining","forward","network","of","policy","and","value",".","act_dim","(","float",")",":","dimension","of","the","action","space",".","policy_lr","(","float",")",":","learning","rate","of","the","policy","model",".","value_lr","(","float",")",":","learning","rate","of","the","value","model",".","epsilon","(","float",")",":","epsilon","used","in","the","CLIP","loss","(","default","0.2",")","."]
code: def __init__(
      self,
      model,
      act_dim=None,
      policy_lr=None,
      value_lr=None,
      epsilon=0.2,
  ):
      """PPO algorithm
  
      Args:
          model (parl.Model): model defining forward network of policy and value.
          act_dim (float): dimension of the action space.
          policy_lr (float): learning rate of the policy model.
          value_lr (float): learning rate of the value model.
          epsilon (float): epsilon used in the CLIP loss (default 0.2).
      """
      self.model = model
      # Used to calculate probability of action in old policy
      self.old_policy_model = deepcopy(model.policy_model)
  
      assert isinstance(act_dim, int)
      assert isinstance(policy_lr, float)
      assert isinstance(value_lr, float)
      assert isinstance(epsilon, float)
      self.act_dim = act_dim
      self.policy_lr = policy_lr
      self.value_lr = value_lr
      self.epsilon = epsilon
  
file_path: PARL/parl/algorithms/fluid/ppo.py
imports: import warnings
  import numpy
  from copy import deepcopy
  from paddle import fluid
  from parl.core.fluid import layers
  from parl.core.fluid.algorithm import Algorithm
label_desc: Use image node_id 1 to create a new PPO object from inherited base classes: Algorithm with example: obj = PPO(model, act_dim, policy_lr, value_lr, epsilon)