docstr: DDPG algorithm
  
  Args:
      model (parl.Model): actor and critic 的前向网络.
                          model 必须实现 get_actor_params() 方法.
      gamma (float): reward的衰减因子.
      tau (float): self.target_model 跟 self.model 同步参数 的 软更新参数
      actor_lr (float): actor 的学习率
      critic_lr (float): critic 的学习率
docstr_tok: ["DDPG","algorithm","Args",":","model","(","parl.Model",")",":","actor","and","critic","\u7684\u524d\u5411\u7f51\u7edc",".","model","\u5fc5\u987b\u5b9e\u73b0","get_actor_params","(",")","\u65b9\u6cd5",".","gamma","(","float",")",":","reward\u7684\u8870\u51cf\u56e0\u5b50",".","tau","(","float",")",":","self.target_model","\u8ddf","self.model","\u540c\u6b65\u53c2\u6570","\u7684","\u8f6f\u66f4\u65b0\u53c2\u6570","actor_lr","(","float",")",":","actor","\u7684\u5b66\u4e60\u7387","critic_lr","(","float",")",":","critic","\u7684\u5b66\u4e60\u7387"]
code: def __init__(
      self, model, gamma=None, tau=None, actor_lr=None, critic_lr=None
  ):
      """DDPG algorithm
  
      Args:
          model (parl.Model): actor and critic 的前向网络.
                              model 必须实现 get_actor_params() 方法.
          gamma (float): reward的衰减因子.
          tau (float): self.target_model 跟 self.model 同步参数 的 软更新参数
          actor_lr (float): actor 的学习率
          critic_lr (float): critic 的学习率
      """
      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(self.model)
      self.actor_optimizer = paddle.optimizer.Adam(
          learning_rate=actor_lr,
          parameters=self.model.get_actor_params(),
      )
      self.critic_optimizer = paddle.optimizer.Adam(
          learning_rate=critic_lr,
          parameters=self.model.get_critic_params(),
      )
  
file_path: PARL/examples/tutorials/parl2_dygraph/lesson5/ddpg/algorithm.py
imports: import parl
  import paddle
  import paddle.nn.functional
  from copy import deepcopy
label_desc: Use image node_id 1 to create a new DDPG object from inherited base classes: parl with example: obj = DDPG(model, gamma, tau, actor_lr, critic_lr)