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"]
docstr: Observe one transition and choose an action.
  
  Args:
      reward (float) : amount of reward returned after previous action.
      next_state (object): observation provided by the environment.
  
  Returns:
      action (int): action choosen by agent.
      debug_info (dict): auxiliary diagnostic information.
docstr_tok: ["Observe","one","transition","and","choose","an","action",".","Args",":","reward","(","float",")",":","amount","of","reward","returned","after","previous","action",".","next_state","(","object",")",":","observation","provided","by","the","environment",".","Returns",":","action","(","int",")",":","action","choosen","by","agent",".","debug_info","(","dict",")",":","auxiliary","diagnostic","information","."]
code: def step(self, reward, next_state):
      """
      Observe one transition and choose an action.
  
      Args:
          reward (float) : amount of reward returned after previous action.
          next_state (object): observation provided by the environment.
  
      Returns:
          action (int): action choosen by agent.
          debug_info (dict): auxiliary diagnostic information.
      """
      next_encoded_state = self._preprocess_state(next_state)
      priority = self._compute_priority(
          self._last_state,
          self._last_action,
          reward,
          next_encoded_state,
      )
      self._replay_memory.store(
          self._last_state,
          self._last_action,
          reward,
          next_encoded_state,
          priority,
      )
      self.step_count += 1
  
      # Update Q every self._parameters.q_update_frequency
      self._update_q_periodically()
  
      self._adjust_exploration_rate()
      self._last_state = next_encoded_state
      self._last_action, action_behavior = self._choose_action(
          self._last_state
      )
      return self._last_action, {
          "action_behavior": action_behavior,
          "epsilon": self._epsilon,
      }
  
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 3 for calling the QLearning obj's underlying member method code with example usage: obj.step(reward, next_state) and returns: self,  dict