docstr: DQN algorithm
  
  Args:
      model (parl.Model): 定义Q函数的前向网络结构
      gamma (float): reward的衰减因子
      lr (float): learning_rate，学习率.
code: def __init__(self, model, gamma=None, lr=None):
      """DQN algorithm
  
      Args:
          model (parl.Model): 定义Q函数的前向网络结构
          gamma (float): reward的衰减因子
          lr (float): learning_rate，学习率.
      """
      # checks
      assert isinstance(gamma, float)
      assert isinstance(lr, float)
  
      self.model = model
      self.target_model = copy.deepcopy(model)
  
      self.gamma = gamma
      self.lr = lr
  
      self.mse_loss = paddle.nn.MSELoss(reduction="mean")
      self.optimizer = paddle.optimizer.Adam(
          learning_rate=lr, parameters=self.model.parameters()
      )
  
file_path: PARL/examples/tutorials/parl2_dygraph/lesson3/dqn/algorithm.py
imports: import copy
  import parl
  import paddle
label_desc: Use image node_id 1 to create a new DQN object from inherited base classes: parl with example: obj = DQN(model, gamma, lr)