class_docstr: A compact implementation of a simplified Rainbow agent.
class_docstr_tok: ["A","compact","implementation","of","a","simplified","Rainbow","agent","."]
docstr: Returns the agent's first action for this episode.
  
  Args:
    observation: numpy array, the environment's initial observation.
  
  Returns:
    int, the selected action.
docstr_tok: ["Returns","the","agent","'s","first","action","for","this","episode",".","Args",":","observation",":","numpy","array",",","the","environment","'s","initial","observation",".","Returns",":","int",",","the","selected","action","."]
code: def begin_episode(self, observation):
      """Returns the agent's first action for this episode.
  
      Args:
        observation: numpy array, the environment's initial observation.
  
      Returns:
        int, the selected action.
      """
      self._reset_state()
      self._record_observation(observation)
  
      if not self.eval_mode:
          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._support,
      )
      # TODO(psc): Why a numpy array? Why not an int?
      self.action = onp.asarray(self.action)
      return self.action
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  from dopamine.jax import losses
  from dopamine.jax import networks
  from dopamine.jax.agents.dqn import dqn_agent
  from dopamine.metrics import statistics_instance
  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 4 for calling the JaxRainbowAgent obj's underlying member method code with example usage: obj.begin_episode(observation) and returns: self