docstr: DQN algorithm
  
  Args:
      model (parl.Model): model defining forward network of Q function
      act_dim (int): dimension of the action space
      gamma (float): discounted factor for reward computation.
      lr (float): learning rate.
docstr_tok: ["DQN","algorithm","Args",":","model","(","parl.Model",")",":","model","defining","forward","network","of","Q","function","act_dim","(","int",")",":","dimension","of","the","action","space","gamma","(","float",")",":","discounted","factor","for","reward","computation",".","lr","(","float",")",":","learning","rate","."]
code: def __init__(self, model, act_dim=None, gamma=None, lr=None):
      """DQN algorithm
  
      Args:
          model (parl.Model): model defining forward network of Q function
          act_dim (int): dimension of the action space
          gamma (float): discounted factor for reward computation.
          lr (float): learning rate.
      """
      self.model = model
      self.target_model = copy.deepcopy(model)
  
      assert isinstance(act_dim, int)
      assert isinstance(gamma, float)
  
      self.act_dim = act_dim
      self.gamma = gamma
      self.lr = lr
  
file_path: PARL/parl/algorithms/fluid/dqn.py
imports: import warnings
  import copy
  import paddle.fluid
  from parl.core.fluid.algorithm import Algorithm
  from parl.core.fluid import layers
label_desc: Use image node_id 1 to create a new DQN object from inherited base classes: Algorithm with example: obj = DQN(model, act_dim, gamma, lr)