class_docstr: A JAX implementation of the Offline DQN agent.
class_docstr_tok: ["A","JAX","implementation","of","the","Offline","DQN","agent","."]
docstr: Initializes the agent and constructs the necessary components.
  
  Args:
    num_actions: int, number of actions the agent can take at any state.
    replay_data_dir: str, log Directory from which to load the replay buffer.
    summary_writer: SummaryWriter object for outputting training statistics
    replay_buffer_builder: Callable object that takes "self" as an argument
      and returns a replay buffer to use for training offline. If None, it
      will use the default FixedReplayBuffer.
    use_tfds: Whether to use tfds replay buffer.
docstr_tok: ["Initializes","the","agent","and","constructs","the","necessary","components",".","Args",":","num_actions",":","int",",","number","of","actions","the","agent","can","take","at","any","state",".","replay_data_dir",":","str",",","log","Directory","from","which","to","load","the","replay","buffer",".","summary_writer",":","SummaryWriter","object","for","outputting","training","statistics","replay_buffer_builder",":","Callable","object","that","takes","``","self","''","as","an","argument","and","returns","a","replay","buffer","to","use","for","training","offline",".","If","None",",","it","will","use","the","default","FixedReplayBuffer",".","use_tfds",":","Whether","to","use","tfds","replay","buffer","."]
code: def __init__(
      self,
      num_actions,
      replay_data_dir,
      summary_writer=None,
      replay_buffer_builder=None,
      use_tfds=False,
  ):
      """Initializes the agent and constructs the necessary components.
  
      Args:
        num_actions: int, number of actions the agent can take at any state.
        replay_data_dir: str, log Directory from which to load the replay buffer.
        summary_writer: SummaryWriter object for outputting training statistics
        replay_buffer_builder: Callable object that takes "self" as an argument
          and returns a replay buffer to use for training offline. If None, it
          will use the default FixedReplayBuffer.
        use_tfds: Whether to use tfds replay buffer.
      """
      logging.info(
          "Creating %s agent with the following parameters:",
          self.__class__.__name__,
      )
      logging.info("\t replay directory: %s", replay_data_dir)
      self.replay_data_dir = replay_data_dir
      self._use_tfds = use_tfds
      if replay_buffer_builder is not None:
          self._build_replay_buffer = replay_buffer_builder
  
      # update_period=1 is a sane default for offline RL. However, this
      # can still be overridden with gin config.
      super().__init__(
          num_actions, update_period=1, summary_writer=summary_writer
      )
  
file_path: dopamine/dopamine/labs/offline_rl/jax/offline_dqn_agent.py
imports: from absl import logging
  from dopamine.jax.agents.dqn import dqn_agent
  from dopamine.labs.offline_rl import fixed_replay
  from dopamine.labs.offline_rl.jax import networks
  from dopamine.labs.offline_rl.rlu_tfds import tfds_replay
  import gin
  import numpy
label_desc: Use image node_id 1 to create a new OfflineJaxDQNAgent object from inherited base classes: dqn_agent with example: obj = OfflineJaxDQNAgent(num_actions, replay_data_dir, summary_writer, replay_buffer_builder, use_tfds)