class_docstr: Defines a configuration class from which a R2D2 Algorithm can be built.
  
  Example:
      >>> from rllib_r2d2.r2d2.r2d2 import R2D2Config
      >>> config = R2D2Config()
      >>> print(config.h_function_epsilon)  # doctest: +SKIP
      >>> replay_config = config.replay_buffer_config.update(
      >>>     {
      >>>         "capacity": 1000000,
      >>>         "replay_burn_in": 20,
      >>>     }
      >>> )
      >>> config.training(replay_buffer_config=replay_config)\  # doctest: +SKIP
      >>>       .resources(num_gpus=1)\
      >>>       .rollouts(num_rollout_workers=30)\
      >>>       .environment("CartPole-v1")
      >>> algo = R2D2(config=config)  # doctest: +SKIP
      >>> algo.train()  # doctest: +SKIP
  
  Example:
      >>> from rllib_r2d2.r2d2.r2d2 import R2D2Config
      >>> from ray import air
      >>> from ray import tune
      >>> config = R2D2Config()
      >>> config.training(train_batch_size=tune.grid_search([256, 64])
      >>> config.environment(env="CartPole-v1")
      >>> tune.Tuner(  # doctest: +SKIP
      ...     "R2D2",
      ...     run_config=air.RunConfig(stop={"episode_reward_mean":200}),
      ...     param_space=config.to_dict()
      ... ).fit()
  
  Example:
      >>> from rllib_r2d2.r2d2.r2d2 import R2D2Config
      >>> config = R2D2Config()
      >>> print(config.exploration_config)  # doctest: +SKIP
      >>> explore_config = config.exploration_config.update(
      >>>     {
      >>>         "initial_epsilon": 1.0,
      >>>         "final_epsilon": 0.1,
      >>>         "epsilone_timesteps": 200000,
      >>>     }
      >>> )
      >>> config.training(lr_schedule=[[1, 1e-3, [500, 5e-3]])\
      >>>       .exploration(exploration_config=explore_config)
  
  Example:
      >>> from rllib_r2d2.r2d2.r2d2 import R2D2Config
      >>> config = R2D2Config()
      >>> print(config.exploration_config)  # doctest: +SKIP
      >>> explore_config = config.exploration_config.update(
      >>>     {
      >>>         "type": "SoftQ",
      >>>         "temperature": [1.0],
      >>>     }
      >>> )
      >>> config.training(lr_schedule=[[1, 1e-3, [500, 5e-3]])\
      >>>       .exploration(exploration_config=explore_config)
class_docstr_tok: ["Defines","a","configuration","class","from","which","a","R2D2","Algorithm","can","be","built",".","Example",":",">",">",">","from","rllib_r2d2.r2d2.r2d2","import","R2D2Config",">",">",">","config","=","R2D2Config","(",")",">",">",">","print","(","config.h_function_epsilon",")","#","doctest",":","+SKIP",">",">",">","replay_config","=","config.replay_buffer_config.update","(",">",">",">","{",">",">",">","``","capacity","''",":","1000000",",",">",">",">","``","replay_burn_in","''",":","20",",",">",">",">","}",">",">",">",")",">",">",">","config.training","(","replay_buffer_config=replay_config",")","\\","#","doctest",":","+SKIP",">",">",">",".resources","(","num_gpus=1",")","\\",">",">",">",".rollouts","(","num_rollout_workers=30",")","\\",">",">",">",".environment","(","``","CartPole-v1","''",")",">",">",">","algo","=","R2D2","(","config=config",")","#","doctest",":","+SKIP",">",">",">","algo.train","(",")","#","doctest",":","+SKIP","Example",":",">",">",">","from","rllib_r2d2.r2d2.r2d2","import","R2D2Config",">",">",">","from","ray","import","air",">",">",">","from","ray","import","tune",">",">",">","config","=","R2D2Config","(",")",">",">",">","config.training","(","train_batch_size=tune.grid_search","(","[","256",",","64","]",")",">",">",">","config.environment","(","env=","''","CartPole-v1","''",")",">",">",">","tune.Tuner","(","#","doctest",":","+SKIP","...","``","R2D2","''",",","...","run_config=air.RunConfig","(","stop=","{","``","episode_reward_mean","''",":200","}",")",",","...","param_space=config.to_dict","(",")","...",")",".fit","(",")","Example",":",">",">",">","from","rllib_r2d2.r2d2.r2d2","import","R2D2Config",">",">",">","config","=","R2D2Config","(",")",">",">",">","print","(","config.exploration_config",")","#","doctest",":","+SKIP",">",">",">","explore_config","=","config.exploration_config.update","(",">",">",">","{",">",">",">","``","initial_epsilon","''",":","1.0",",",">",">",">","``","final_epsilon","''",":","0.1",",",">",">",">","``","epsilone_timesteps","''",":","200000",",",">",">",">","}",">",">",">",")",">",">",">","config.training","(","lr_schedule=","[","[","1",",","1e-3",",","[","500",",","5e-3","]","]",")","\\",">",">",">",".exploration","(","exploration_config=explore_config",")","Example",":",">",">",">","from","rllib_r2d2.r2d2.r2d2","import","R2D2Config",">",">",">","config","=","R2D2Config","(",")",">",">",">","print","(","config.exploration_config",")","#","doctest",":","+SKIP",">",">",">","explore_config","=","config.exploration_config.update","(",">",">",">","{",">",">",">","``","type","''",":","``","SoftQ","''",",",">",">",">","``","temperature","''",":","[","1.0","]",",",">",">",">","}",">",">",">",")",">",">",">","config.training","(","lr_schedule=","[","[","1",",","1e-3",",","[","500",",","5e-3","]","]",")","\\",">",">",">",".exploration","(","exploration_config=explore_config",")"]
docstr: Sets the training related configuration.
  
  Args:
      zero_init_states: If True, assume a zero-initialized state input (no
          matter where in the episode the sequence is located).
          If False, store the initial states along with each SampleBatch, use
          it (as initial state when running through the network for training),
          and update that initial state during training (from the internal
          state outputs of the immediately preceding sequence).
      use_h_function: Whether to use the h-function from the paper [1] to scale
          target values in the R2D2-loss function:
          h(x) = sign(x)(􏰅|x| + 1 − 1) + εx
      h_function_epsilon: The epsilon parameter from the R2D2 loss function (only
          used if `use_h_function`=True.
  
  Returns:
      This updated AlgorithmConfig object.
docstr_tok: ["Sets","the","training","related","configuration",".","Args",":","zero_init_states",":","If","True",",","assume","a","zero-initialized","state","input","(","no","matter","where","in","the","episode","the","sequence","is","located",")",".","If","False",",","store","the","initial","states","along","with","each","SampleBatch",",","use","it","(","as","initial","state","when","running","through","the","network","for","training",")",",","and","update","that","initial","state","during","training","(","from","the","internal","state","outputs","of","the","immediately","preceding","sequence",")",".","use_h_function",":","Whether","to","use","the","h-function","from","the","paper","[","1","]","to","scale","target","values","in","the","R2D2-loss","function",":","h","(","x",")","=","sign","(","x",")","(","\udbff\udc05|x|","+","1","\u2212","1",")","+","\u03b5x","h_function_epsilon",":","The","epsilon","parameter","from","the","R2D2","loss","function","(","only","used","if","`","use_h_function","`","=True",".","Returns",":","This","updated","AlgorithmConfig","object","."]
code: def training(
      self,
      *,
      zero_init_states: Optional[bool] = NotProvided,
      use_h_function: Optional[bool] = NotProvided,
      h_function_epsilon: Optional[float] = NotProvided,
      **kwargs,
  ) -> "R2D2Config":
      """Sets the training related configuration.
  
      Args:
          zero_init_states: If True, assume a zero-initialized state input (no
              matter where in the episode the sequence is located).
              If False, store the initial states along with each SampleBatch, use
              it (as initial state when running through the network for training),
              and update that initial state during training (from the internal
              state outputs of the immediately preceding sequence).
          use_h_function: Whether to use the h-function from the paper [1] to scale
              target values in the R2D2-loss function:
              h(x) = sign(x)(􏰅|x| + 1 − 1) + εx
          h_function_epsilon: The epsilon parameter from the R2D2 loss function (only
              used if `use_h_function`=True.
  
      Returns:
          This updated AlgorithmConfig object.
      """
      # Pass kwargs onto super's `training()` method.
      super().training(**kwargs)
  
      if zero_init_states is not NotProvided:
          self.zero_init_states = zero_init_states
      if use_h_function is not NotProvided:
          self.use_h_function = use_h_function
      if h_function_epsilon is not NotProvided:
          self.h_function_epsilon = h_function_epsilon
  
      return self
  
file_path: ray/rllib_contrib/r2d2/src/rllib_r2d2/r2d2/r2d2.py
imports: import logging
  from typing import Optional, Type
  from rllib_r2d2.r2d2.r2d2_tf_policy import R2D2TFPolicy
  from rllib_r2d2.r2d2.r2d2_torch_policy import R2D2TorchPolicy
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig, NotProvided
  from ray.rllib.algorithms.dqn import DQN, DQNConfig
  from ray.rllib.policy.policy import Policy
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.deprecation import DEPRECATED_VALUE
label_desc: Use image node_id 2 for calling the R2D2Config obj's underlying member method code with example usage: obj.training() and returns: self