docstr: DDPG algorithm
  
  Args:
      model (parl.Model): forward network of actor and critic.
                          The function get_actor_params() of model should be implemented.
      gamma (float): discounted factor for reward computation.
      tau (float): decay coefficient when updating the weights of self.target_model with self.model
      actor_lr (float): learning rate of the actor model
      critic_lr (float): learning rate of the critic model
docstr_tok: ["DDPG","algorithm","Args",":","model","(","parl.Model",")",":","forward","network","of","actor","and","critic",".","The","function","get_actor_params","(",")","of","model","should","be","implemented",".","gamma","(","float",")",":","discounted","factor","for","reward","computation",".","tau","(","float",")",":","decay","coefficient","when","updating","the","weights","of","self.target_model","with","self.model","actor_lr","(","float",")",":","learning","rate","of","the","actor","model","critic_lr","(","float",")",":","learning","rate","of","the","critic","model"]
code: def __init__(
      self, model, gamma=None, tau=None, actor_lr=None, critic_lr=None
  ):
      """DDPG algorithm
  
      Args:
          model (parl.Model): forward network of actor and critic.
                              The function get_actor_params() of model should be implemented.
          gamma (float): discounted factor for reward computation.
          tau (float): decay coefficient when updating the weights of self.target_model with self.model
          actor_lr (float): learning rate of the actor model
          critic_lr (float): learning rate of the critic model
      """
      assert isinstance(gamma, float)
      assert isinstance(tau, float)
      assert isinstance(actor_lr, float)
      assert isinstance(critic_lr, float)
      self.gamma = gamma
      self.tau = tau
      self.actor_lr = actor_lr
      self.critic_lr = critic_lr
  
      self.model = model
      self.target_model = deepcopy(model)
  
file_path: PARL/parl/algorithms/fluid/ddpg.py
imports: import warnings
  from parl.core.fluid import layers
  from copy import deepcopy
  from paddle import fluid
  from parl.core.fluid.algorithm import Algorithm
label_desc: Use image node_id 1 to create a new DDPG object from inherited base classes: Algorithm with example: obj = DDPG(model, gamma, tau, actor_lr, critic_lr)