class_docstr: Offline Rainbow agent with BC regularization (akin to CQL).
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.
    td_coefficient: float, Coefficient for the DR3 regularizer.
    bc_coefficient: float, Coefficient for the CQL loss.
    summary_writer: SummaryWriter object for outputting training statistics.
    add_return_to_go: Whether to add return to go to the replay data.
    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",".","td_coefficient",":","float",",","Coefficient","for","the","DR3","regularizer",".","bc_coefficient",":","float",",","Coefficient","for","the","CQL","loss",".","summary_writer",":","SummaryWriter","object","for","outputting","training","statistics",".","add_return_to_go",":","Whether","to","add","return","to","go","to","the","replay","data",".","use_tfds",":","Whether","to","use","tfds","replay","buffer","."]
code: def __init__(
      self,
      num_actions,
      replay_data_dir,
      td_coefficient=1.0,
      bc_coefficient=0.0,
      summary_writer=None,
      add_return_to_go=False,
      use_tfds=True,
  ):
      """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.
        td_coefficient: float, Coefficient for the DR3 regularizer.
        bc_coefficient: float, Coefficient for the CQL loss.
        summary_writer: SummaryWriter object for outputting training statistics.
        add_return_to_go: Whether to add return to go to the replay data.
        use_tfds: Whether to use tfds replay buffer.
      """
  
      logging.info(
          "Creating OfflineJaxRainbowAgent with the parameters:"
      )
      logging.info("\t replay directory: %s", replay_data_dir)
      logging.info("\t TD coefficient: %s", td_coefficient)
      logging.info("\t CQL coefficient: %s", bc_coefficient)
      logging.info("\t Return To Go: %s", add_return_to_go)
  
      self.replay_data_dir = replay_data_dir
      self._use_tfds = use_tfds
      self._td_coefficient = td_coefficient
      self._bc_coefficient = bc_coefficient
      self._add_return_to_go = add_return_to_go
  
      super().__init__(
          num_actions,
          noisy=False,  # No need for noisy networks for offline RL.
          replay_scheme="uniform",  # Uniform replay is default for offline RL.
          summary_writer=summary_writer,
      )
  
imports: import functools
  from absl import logging
  from dopamine.jax import losses
  from dopamine.jax.agents.full_rainbow import full_rainbow_agent
  from dopamine.jax.agents.rainbow import rainbow_agent
  from dopamine.labs.offline_rl import fixed_replay
  from dopamine.labs.offline_rl.rlu_tfds import tfds_replay
  import gin
  import jax
  import jax.numpy
  import numpy
  import optax
  import tensorflow
label_desc: Use image node_id 1 to create a new OfflineJaxRainbowAgent object from inherited base classes: full_rainbow_agent with example: obj = OfflineJaxRainbowAgent(num_actions, replay_data_dir, td_coefficient, bc_coefficient, summary_writer, add_return_to_go, use_tfds)