class_docstr: Agent of Atari env.
  
  Args:
      algorithm (`parl.Algorithm`): algorithm to be used in this agent.
      act_dim (int): action space dimension
      start_lr (float): starting learning rate
      total_step (int): total learning rate and epsilon decay steps
      update_target_step (int): target network update frequency
docstr: Update model with an episode data
  
  Args:
      obs (np.float32): shape of (batch_size, obs_dim)
      act (np.int32): shape of (batch_size)
      reward (np.float32): shape of (batch_size)
      next_obs (np.float32): shape of (batch_size, obs_dim)
      terminal (np.float32): shape of (batch_size)
  
  Returns:
      loss (float)
code: def learn(self, obs, act, reward, next_obs, terminal):
      """Update model with an episode data
  
      Args:
          obs (np.float32): shape of (batch_size, obs_dim)
          act (np.int32): shape of (batch_size)
          reward (np.float32): shape of (batch_size)
          next_obs (np.float32): shape of (batch_size, obs_dim)
          terminal (np.float32): shape of (batch_size)
  
      Returns:
          loss (float)
      """
      if self.global_update_step % self.update_target_step == 0:
          self.alg.sync_target()
  
      self.global_update_step += 1
  
      reward = np.clip(reward, -1, 1)
      act = np.expand_dims(act, axis=-1)
      reward = np.expand_dims(reward, axis=-1)
      terminal = np.expand_dims(terminal, axis=-1)
  
      obs = paddle.to_tensor(obs, dtype="float32")
      act = paddle.to_tensor(act, dtype="int32")
      reward = paddle.to_tensor(reward, dtype="float32")
      next_obs = paddle.to_tensor(next_obs, dtype="float32")
      terminal = paddle.to_tensor(terminal, dtype="float32")
  
      loss = self.alg.learn(obs, act, reward, next_obs, terminal)
  
      # learning rate decay
      self.alg.optimizer.set_lr(
          max(self.lr_scheduler.step(1), self.lr_end)
      )
      return float(loss)
  
file_path: PARL/examples/DQN_variant/atari_agent.py
imports: import parl
  import numpy
  import paddle
  from parl.utils.scheduler import LinearDecayScheduler
label_desc: Use image node_id 4 for calling the AtariAgent obj's underlying member method code with example usage: obj.learn(obs, act, reward, next_obs, terminal) and returns: float