class_docstr: An implementation of the DQN agent.
class_docstr_tok: ["An","implementation","of","the","DQN","agent","."]
docstr: Build an op used as a target for the Q-value.
  
  Returns:
    target_q_op: An op calculating the Q-value.
docstr_tok: ["Build","an","op","used","as","a","target","for","the","Q-value",".","Returns",":","target_q_op",":","An","op","calculating","the","Q-value","."]
code: def _build_target_q_op(self):
      """Build an op used as a target for the Q-value.
  
      Returns:
        target_q_op: An op calculating the Q-value.
      """
      # Get the maximum Q-value across the actions dimension.
      replay_next_qt_max = tf.reduce_max(
          self._replay_next_target_net_outputs.q_values, 1
      )
      # Calculate the Bellman target value.
      #   Q_t = R_t + \gamma^N * Q'_t+1
      # where,
      #   Q'_t+1 = \argmax_a Q(S_t+1, a)
      #          (or) 0 if S_t is a terminal state,
      # and
      #   N is the update horizon (by default, N=1).
      return (
          self._replay.rewards
          + self.cumulative_gamma
          * replay_next_qt_max
          * (1.0 - tf.cast(self._replay.terminals, tf.float32))
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import random
  from absl import logging
  from dopamine.discrete_domains import atari_lib
  from dopamine.replay_memory import circular_replay_buffer
  import gin.tf
  import numpy
  import tensorflow
label_desc: Use image node_id 5 for calling the DQNAgent obj's underlying member method code with example usage: obj._build_target_q_op() and returns: unknown