class_docstr: A JAX implementation of the DQN agent.
class_docstr_tok: ["A","JAX","implementation","of","the","DQN","agent","."]
docstr: Records the most recent transition and returns the agent's next action.
  
  We store the observation of the last time step since we want to store it
  with the reward.
  
  Args:
    reward: float, the reward received from the agent's most recent action.
    observation: numpy array, the most recent observation.
  
  Returns:
    int, the selected action.
docstr_tok: ["Records","the","most","recent","transition","and","returns","the","agent","'s","next","action",".","We","store","the","observation","of","the","last","time","step","since","we","want","to","store","it","with","the","reward",".","Args",":","reward",":","float",",","the","reward","received","from","the","agent","'s","most","recent","action",".","observation",":","numpy","array",",","the","most","recent","observation",".","Returns",":","int",",","the","selected","action","."]
code: def step(self, reward, observation):
      """Records the most recent transition and returns the agent's next action.
  
      We store the observation of the last time step since we want to store it
      with the reward.
  
      Args:
        reward: float, the reward received from the agent's most recent action.
        observation: numpy array, the most recent observation.
  
      Returns:
        int, the selected action.
      """
      self._last_observation = self._observation
      self._record_observation(observation)
  
      if not self.eval_mode:
          self._store_transition(
              self._last_observation, self.action, reward, False
          )
          self._train_step()
  
      self._rng, self.action = select_action(
          self.network_def,
          self.online_params,
          self.preprocess_fn(self.state),
          self._rng,
          self.num_actions,
          self.eval_mode,
          self.epsilon_eval,
          self.epsilon_train,
          self.epsilon_decay_period,
          self.training_steps,
          self.min_replay_history,
          self.epsilon_fn,
      )
      self.action = onp.asarray(self.action)
      return self.action
  
imports: import collections
  import functools
  import inspect
  import math
  import time
  from absl import logging
  from dopamine.agents.dqn import dqn_agent
  from dopamine.jax import losses
  from dopamine.jax import networks
  from dopamine.metrics import statistics_instance
  from dopamine.replay_memory import circular_replay_buffer
  from dopamine.replay_memory import prioritized_replay_buffer
  import gin
  import jax
  import jax.numpy
  import numpy
  import optax
  import tensorflow
label_desc: Use image node_id 9 for calling the JaxDQNAgent obj's underlying member method code with example usage: obj.step(reward, observation) and returns: self