docstr: DQN algorithm
  
  Args:
      model (parl.Model): 定义Q函数的前向网络结构
      act_dim (int): action空间的维度，即有几个action
      gamma (float): reward的衰减因子
      lr (float): learning_rate，学习率.
docstr_tok: ["DQN","algorithm","Args",":","model","(","parl.Model",")",":","\u5b9a\u4e49Q\u51fd\u6570\u7684\u524d\u5411\u7f51\u7edc\u7ed3\u6784","act_dim","(","int",")",":","action\u7a7a\u95f4\u7684\u7ef4\u5ea6\uff0c\u5373\u6709\u51e0\u4e2aaction","gamma","(","float",")",":","reward\u7684\u8870\u51cf\u56e0\u5b50","lr","(","float",")",":","learning_rate\uff0c\u5b66\u4e60\u7387","."]
code: def __init__(self, model, act_dim=None, gamma=None, lr=None):
      """DQN algorithm
  
      Args:
          model (parl.Model): 定义Q函数的前向网络结构
          act_dim (int): action空间的维度，即有几个action
          gamma (float): reward的衰减因子
          lr (float): learning_rate，学习率.
      """
      self.model = model
      self.target_model = copy.deepcopy(model)
  
      assert isinstance(act_dim, int)
      assert isinstance(gamma, float)
      assert isinstance(lr, float)
      self.act_dim = act_dim
      self.gamma = gamma
      self.lr = lr
  
file_path: PARL/examples/tutorials/lesson3/dqn/algorithm.py
imports: import copy
  import paddle.fluid
  import parl
  from parl import layers
label_desc: Use image node_id 1 to create a new DQN object from inherited base classes: parl with example: obj = DQN(model, act_dim, gamma, lr)