class_docstr: Large-scale implementation of Augmented Random Search in Ray.
class_docstr_tok: ["Large-scale","implementation","of","Augmented","Random","Search","in","Ray","."]
code: def setup(self, config: AlgorithmConfig):
      # Setup our config: Merge the user-supplied config (which could
      # be a partial config dict with the class' default).
      if isinstance(config, dict):
          self.config = self.get_default_config().update_from_dict(
              config
          )
  
      # Validate our config dict.
      self.config.validate()
  
      # Generate the local env.
      env_context = EnvContext(
          self.config.env_config or {}, worker_index=0
      )
      env = self.env_creator(env_context)
  
      self.callbacks = self.config.callbacks_class()
  
      self._policy_class = get_policy_class(self.config)
      self.policy = self._policy_class(
          env.observation_space, env.action_space, self.config
      )
      self.optimizer = optimizers.SGD(
          self.policy, self.config.sgd_stepsize
      )
  
      self.rollouts_used = self.config.rollouts_used
      self.num_rollouts = self.config.num_rollouts
      self.report_length = self.config.report_length
  
      # Create the shared noise table.
      logger.info("Creating shared noise table.")
      noise_id = create_shared_noise.remote(self.config.noise_size)
      self.noise = SharedNoiseTable(ray.get(noise_id))
  
      # Create the actors.
      logger.info("Creating actors.")
  
      remote_workers = [
          Worker.remote(
              self.config, self.env_creator, noise_id, idx + 1
          )
          for idx in range(self.config.num_rollout_workers)
      ]
      self.workers = WorkerSet._from_existing(
          local_worker=None,
          remote_workers=remote_workers,
      )
  
      self.episodes_so_far = 0
      self.reward_list = []
      self.tstart = time.time()
  
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 ARS obj's underlying member method code with example usage: obj.setup(config) without return types