class_docstr: Defines a configuration class from which an ARS Algorithm can be built.
  
  Example:
      >>> from ray.rllib.algorithms.ars import ARSConfig
      >>> config = ARSConfig()  # doctest: +SKIP
      >>> config = config.training(report_length=20) # doctest: +SKIP
      >>> config = config.resources(num_gpus=0)  # doctest: +SKIP
      >>> config = config.rollouts(num_rollout_workers=4)  # doctest: +SKIP
      >>> config = config.environment("CartPole-v1")  # doctest: +SKIP
      >>> print(config.to_dict())  # doctest: +SKIP
      >>> # Build a Algorithm object from the config and run 1 training iteration.
      >>> algo = config.build()  # doctest: +SKIP
      >>> algo.train()  # doctest: +SKIP
  
  Example:
      >>> from ray.rllib.algorithms.ars import ARSConfig
      >>> from ray import air
      >>> from ray import tune
      >>> config = ARSConfig()
      >>> # Print out some default values.
      >>> print(config.action_noise_std)  # doctest: +SKIP
      >>> # Update the config object.
      >>> config = config.training(  # doctest: +SKIP
      ...     rollouts_used=tune.grid_search([32, 64]), eval_prob=0.5)
      >>> # Set the config object's env.
      >>> config = config.environment(env="CartPole-v1")  # doctest: +SKIP
      >>> # Use to_dict() to get the old-style python config dict
      >>> # when running with tune.
      >>> tune.Tuner(  # doctest: +SKIP
      ...     "ARS",
      ...     run_config=air.RunConfig(stop={"episode_reward_mean": 200}),
      ...     param_space=config.to_dict(),
      ... ).fit()
class_docstr_tok: ["Defines","a","configuration","class","from","which","an","ARS","Algorithm","can","be","built",".","Example",":",">",">",">","from","ray.rllib.algorithms.ars","import","ARSConfig",">",">",">","config","=","ARSConfig","(",")","#","doctest",":","+SKIP",">",">",">","config","=","config.training","(","report_length=20",")","#","doctest",":","+SKIP",">",">",">","config","=","config.resources","(","num_gpus=0",")","#","doctest",":","+SKIP",">",">",">","config","=","config.rollouts","(","num_rollout_workers=4",")","#","doctest",":","+SKIP",">",">",">","config","=","config.environment","(","``","CartPole-v1","''",")","#","doctest",":","+SKIP",">",">",">","print","(","config.to_dict","(",")",")","#","doctest",":","+SKIP",">",">",">","#","Build","a","Algorithm","object","from","the","config","and","run","1","training","iteration",".",">",">",">","algo","=","config.build","(",")","#","doctest",":","+SKIP",">",">",">","algo.train","(",")","#","doctest",":","+SKIP","Example",":",">",">",">","from","ray.rllib.algorithms.ars","import","ARSConfig",">",">",">","from","ray","import","air",">",">",">","from","ray","import","tune",">",">",">","config","=","ARSConfig","(",")",">",">",">","#","Print","out","some","default","values",".",">",">",">","print","(","config.action_noise_std",")","#","doctest",":","+SKIP",">",">",">","#","Update","the","config","object",".",">",">",">","config","=","config.training","(","#","doctest",":","+SKIP","...","rollouts_used=tune.grid_search","(","[","32",",","64","]",")",",","eval_prob=0.5",")",">",">",">","#","Set","the","config","object","'s","env",".",">",">",">","config","=","config.environment","(","env=","''","CartPole-v1","''",")","#","doctest",":","+SKIP",">",">",">","#","Use","to_dict","(",")","to","get","the","old-style","python","config","dict",">",">",">","#","when","running","with","tune",".",">",">",">","tune.Tuner","(","#","doctest",":","+SKIP","...","``","ARS","''",",","...","run_config=air.RunConfig","(","stop=","{","``","episode_reward_mean","''",":","200","}",")",",","...","param_space=config.to_dict","(",")",",","...",")",".fit","(",")"]
docstr: Sets the training related configuration.
  
  Args:
      action_noise_std: Std. deviation to be used when adding (standard normal)
          noise to computed actions. Action noise is only added, if
          `compute_actions` is called with the `add_noise` arg set to True.
      noise_stdev: Std. deviation of parameter noise.
      num_rollouts: Number of perturbs to try.
      rollouts_used: Number of perturbs to keep in gradient estimate.
      sgd_stepsize: SGD step-size used for the Adam optimizer.
      noise_size: Number of rows in the noise table (shared across workers).
          Each row contains a gaussian noise value for each model parameter.
      eval_prob: Probability of evaluating the parameter rewards.
      report_length: How many of the last rewards we average over.
      offset: Value to subtract from the reward (e.g. survival bonus
          from humanoid) during rollouts.
      tf_single_threaded: Whether the tf-session should be generated without any
          parallelism options.
  
  Returns:
      This updated AlgorithmConfig object.
code: def training(
      self,
      *,
      action_noise_std: Optional[float] = NotProvided,
      noise_stdev: Optional[float] = NotProvided,
      num_rollouts: Optional[int] = NotProvided,
      rollouts_used: Optional[int] = NotProvided,
      sgd_stepsize: Optional[float] = NotProvided,
      noise_size: Optional[int] = NotProvided,
      eval_prob: Optional[float] = NotProvided,
      report_length: Optional[int] = NotProvided,
      offset: Optional[int] = NotProvided,
      tf_single_threaded: Optional[bool] = NotProvided,
      **kwargs,
  ) -> "ARSConfig":
      """Sets the training related configuration.
  
      Args:
          action_noise_std: Std. deviation to be used when adding (standard normal)
              noise to computed actions. Action noise is only added, if
              `compute_actions` is called with the `add_noise` arg set to True.
          noise_stdev: Std. deviation of parameter noise.
          num_rollouts: Number of perturbs to try.
          rollouts_used: Number of perturbs to keep in gradient estimate.
          sgd_stepsize: SGD step-size used for the Adam optimizer.
          noise_size: Number of rows in the noise table (shared across workers).
              Each row contains a gaussian noise value for each model parameter.
          eval_prob: Probability of evaluating the parameter rewards.
          report_length: How many of the last rewards we average over.
          offset: Value to subtract from the reward (e.g. survival bonus
              from humanoid) during rollouts.
          tf_single_threaded: Whether the tf-session should be generated without any
              parallelism options.
  
      Returns:
          This updated AlgorithmConfig object.
      """
      # Pass kwargs onto super's `training()` method.
      super().training(**kwargs)
  
      if action_noise_std is not NotProvided:
          self.action_noise_std = action_noise_std
      if noise_stdev is not NotProvided:
          self.noise_stdev = noise_stdev
      if num_rollouts is not NotProvided:
          self.num_rollouts = num_rollouts
      if rollouts_used is not NotProvided:
          self.rollouts_used = rollouts_used
      if sgd_stepsize is not NotProvided:
          self.sgd_stepsize = sgd_stepsize
      if noise_size is not NotProvided:
          self.noise_size = noise_size
      if eval_prob is not NotProvided:
          self.eval_prob = eval_prob
      if report_length is not NotProvided:
          self.report_length = report_length
      if offset is not NotProvided:
          self.offset = offset
      if tf_single_threaded is not NotProvided:
          self.tf_single_threaded = tf_single_threaded
  
      return self
  
imports: import logging
  import random
  import time
  from collections import namedtuple
  from typing import Optional
  import numpy
  from rllib_ars.ars.ars_tf_policy import ARSTFPolicy
  import ray
  from ray.rllib.algorithms import Algorithm
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig, NotProvided
  from ray.rllib.algorithms.es import optimizers, utils
  from ray.rllib.algorithms.es.es_tf_policy import rollout
  from ray.rllib.env.env_context import EnvContext
  from ray.rllib.evaluation.worker_set import WorkerSet
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
  from ray.rllib.utils import FilterManager
  from ray.rllib.utils.actor_manager import FaultAwareApply
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.metrics import NUM_AGENT_STEPS_SAMPLED, NUM_AGENT_STEPS_TRAINED, NUM_ENV_STEPS_SAMPLED, NUM_ENV_STEPS_TRAINED
  from ray.rllib.utils.torch_utils import set_torch_seed
label_desc: Use image node_id 2 for calling the ARSConfig obj's underlying member method code with example usage: obj.training() and returns: self