class_docstr: Categorical DQN.
  
  See https://arxiv.org/abs/1707.06887.
  
  Arguments are the same as those of DQN except q_function must return
  DistributionalDiscreteActionValue and clip_delta is ignored.
class_docstr_tok: ["Categorical","DQN",".","See","https",":","\/\/arxiv.org\/abs\/1707.06887",".","Arguments","are","the","same","as","those","of","DQN","except","q_function","must","return","DistributionalDiscreteActionValue","and","clip_delta","is","ignored","."]
docstr: Compute a batch of target return distributions.
docstr_tok: ["Compute","a","batch","of","target","return","distributions","."]
code: def _compute_target_values(self, exp_batch):
      """Compute a batch of target return distributions."""
  
      batch_next_state = exp_batch["next_state"]
      if self.recurrent:
          target_next_qout, _ = self.target_model.n_step_forward(
              batch_next_state,
              exp_batch["next_recurrent_state"],
              output_mode="concat",
          )
      else:
          target_next_qout = self.target_model(batch_next_state)
  
      batch_rewards = exp_batch["reward"]
      batch_terminal = exp_batch["is_state_terminal"]
  
      batch_size = exp_batch["reward"].shape[0]
      z_values = target_next_qout.z_values
      n_atoms = z_values.size
  
      # next_q_max: (batch_size, n_atoms)
      next_q_max = target_next_qout.max_as_distribution.array
      assert next_q_max.shape == (batch_size, n_atoms), next_q_max.shape
  
      # Tz: (batch_size, n_atoms)
      Tz = (
          batch_rewards[..., None]
          + (1.0 - batch_terminal[..., None])
          * self.xp.expand_dims(exp_batch["discount"], 1)
          * z_values[None]
      )
      return _apply_categorical_projection(Tz, next_q_max, z_values)
  
file_path: chainerrl/chainerrl/agents/categorical_dqn.py
imports: import chainer
  from chainer import cuda
  import chainer.functions
  import numpy
  from chainerrl.agents import dqn
label_desc: Use image node_id 1 for calling the CategoricalDQN obj's underlying member method code with example usage: obj._compute_target_values(exp_batch) and returns: _apply_categorical_projection