class_docstr: Q-learning agent.
  
  Including:
  - DQN https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf
  - Prioritized Experience Replay https://arxiv.org/pdf/1511.05952.pdf
  - Dueling Network https://arxiv.org/pdf/1511.06581.pdf
  - Double Q Learning https://arxiv.org/pdf/1509.06461.pdf
class_docstr_tok: ["Q-learning","agent",".","Including",":","-","DQN","https",":","\/\/storage.googleapis.com\/deepmind-media\/dqn\/DQNNaturePaper.pdf","-","Prioritized","Experience","Replay","https",":","\/\/arxiv.org\/pdf\/1511.05952.pdf","-","Dueling","Network","https",":","\/\/arxiv.org\/pdf\/1511.06581.pdf","-","Double","Q","Learning","https",":","\/\/arxiv.org\/pdf\/1509.06461.pdf"]
code: def _compute_td_err(self, state, action, reward, next_state):
      td_err = reward
      if next_state is not None:
          if self._parameters.double_q_learning:
              td_err += self._parameters.gamma * self._evaluate_q(
                  self._target_q,
                  next_state,
                  np.argmax(self._evaluate_q(self._q, next_state)),
              )
          else:
              td_err += self._parameters.gamma * np.max(
                  self._evaluate_q(self._target_q, next_state)
              )
      td_err -= self._evaluate_q(self._q, state, action)
      return td_err
  
imports: import math
  import cntk
  import numpy
  import ast
  from .agent import AgentBaseClass
  from .shared.cntk_utils import huber_loss
  from .shared.models import Models
  from .shared.qlearning_parameters import QLearningParameters
  from .shared.replay_memory import ReplayMemory
label_desc: Use image node_id 15 for calling the QLearning obj's underlying member method code with example usage: obj._compute_td_err(state, action, reward, next_state) and returns: td_err