code: def __init__(
      self,
      name,
      game_inputs=None,
      callbacks=None,
      seed=420133769,
      rainbow_kwargs=None,
      logger=Loggers.NOOP,
      logger_kwargs=None,
  ):
      super().__init__(
          name,
          game_inputs=game_inputs,
          callbacks=callbacks,
          seed=seed,
          logger=logger,
          logger_kwargs=logger_kwargs,
      )
  
      if len(game_inputs) > 1:
          raise SerpentError(
              "RainbowDQNAgent only supports a single axis of game inputs."
          )
  
      if game_inputs[0]["control_type"] != InputControlTypes.DISCRETE:
          raise SerpentError(
              "RainbowDQNAgent only supports discrete input spaces"
          )
  
      if torch.cuda.is_available():
          self.device = torch.device("cuda")
  
          torch.set_default_tensor_type("torch.cuda.FloatTensor")
          torch.backends.cudnn.enabled = False
  
          torch.cuda.manual_seed_all(seed)
      else:
          self.device = torch.device("cpu")
          torch.set_num_threads(1)
  
      torch.manual_seed(seed)
  
      agent_kwargs = dict(
          algorithm="Rainbow DQN",
          replay_memory_capacity=100000,
          history=4,
          discount=0.99,
          multi_step=3,
          priority_weight=0.4,
          priority_exponent=0.5,
          atoms=51,
          v_min=-10,
          v_max=10,
          batch_size=32,
          hidden_size=1024,
          noisy_std=0.1,
          learning_rate=0.0000625,
          adam_epsilon=1.5e-4,
          max_grad_norm=10,
          target_update=10000,
          save_steps=5000,
          observe_steps=50000,
          max_steps=5000000,
          model=f"datasets/rainbow_dqn_{self.name}.pth",
          seed=seed,
      )
  
      if isinstance(rainbow_kwargs, dict):
          for key, value in rainbow_kwargs.items():
              if key in agent_kwargs:
                  agent_kwargs[key] = value
  
      self.agent = RainbowAgent(
          len(self.game_inputs[0]["inputs"]),
          self.device,
          atoms=agent_kwargs["atoms"],
          v_min=agent_kwargs["v_min"],
          v_max=agent_kwargs["v_max"],
          batch_size=agent_kwargs["batch_size"],
          multi_step=agent_kwargs["multi_step"],
          discount=agent_kwargs["discount"],
          history=agent_kwargs["history"],
          hidden_size=agent_kwargs["hidden_size"],
          noisy_std=agent_kwargs["noisy_std"],
          learning_rate=agent_kwargs["learning_rate"],
          adam_epsilon=agent_kwargs["adam_epsilon"],
          max_grad_norm=agent_kwargs["max_grad_norm"],
          model=agent_kwargs["model"],
      )
  
      self.replay_memory = ReplayMemory(
          agent_kwargs["replay_memory_capacity"],
          self.device,
          history=agent_kwargs["history"],
          discount=agent_kwargs["discount"],
          multi_step=agent_kwargs["multi_step"],
          priority_weight=agent_kwargs["priority_weight"],
          priority_exponent=agent_kwargs["priority_exponent"],
      )
  
      self.priority_weight_increase = (
          1 - agent_kwargs["priority_weight"]
      ) / (agent_kwargs["max_steps"] - agent_kwargs["observe_steps"])
  
      self.target_update = agent_kwargs["target_update"]
  
      self.save_steps = agent_kwargs["save_steps"]
      self.observe_steps = agent_kwargs["observe_steps"]
      self.max_steps = agent_kwargs["max_steps"]
  
      self.remaining_observe_steps = self.observe_steps
  
      self.current_episode = 1
      self.current_step = 0
  
      self.current_action = -1
  
      self.observe_mode = "RANDOM"
      self.set_mode(RainbowDQNAgentModes.OBSERVE)
  
      self.model = agent_kwargs["model"]
  
      if os.path.isfile(self.model):
          self.observe_mode = "MODEL"
          self.restore_model()
  
      self.logger.log_hyperparams(agent_kwargs)
  
      if (
          self._has_human_input_recording()
          and self.observe_mode == "RANDOM"
      ):
          self.add_human_observations_to_replay_memory()
  
imports: from serpent.machine_learning.reinforcement_learning.agent import Agent
  from serpent.game_frame import GameFrame
  from serpent.game_frame_buffer import GameFrameBuffer
  from serpent.input_controller import KeyboardEvent, MouseEvent
  from serpent.enums import InputControlTypes
  from serpent.logger import Loggers
  from serpent.utilities import SerpentError
  import os
  import io
  import enum
  import random
  import json
  import numpy
  import h5py
  import skimage.io
  import skimage.util
label_desc: Use image node_id 1 to create a new RainbowDQNAgent object from inherited base classes: Agent with example: obj = RainbowDQNAgent(name, game_inputs, callbacks, seed, rainbow_kwargs, logger, logger_kwargs)