class_docstr: Defines a configuration class from which a A3C Algorithm can be built.
  
  Example:
      >>> from ray import tune
      >>> from ray.rllib.algorithms.a3c import A3CConfig
      >>> config = A3CConfig() # doctest: +SKIP
      >>> config = config.training(lr=0.01, grad_clip=30.0) # 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.a3c import A3CConfig
      >>> config = A3CConfig()
      >>> # Print out some default values.
      >>> print(config.sample_async)  # doctest: +SKIP
      >>> # Update the config object.
      >>> config = config.training( # doctest: +SKIP
      ...     lr=tune.grid_search([0.001, 0.0001]), use_critic=False)
      >>> # 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
      ...     "A3C",
      ...     stop={"episode_reward_mean": 200},
      ...     param_space=config.to_dict(),
      ... ).fit()
class_docstr_tok: ["Defines","a","configuration","class","from","which","a","A3C","Algorithm","can","be","built",".","Example",":",">",">",">","from","ray","import","tune",">",">",">","from","ray.rllib.algorithms.a3c","import","A3CConfig",">",">",">","config","=","A3CConfig","(",")","#","doctest",":","+SKIP",">",">",">","config","=","config.training","(","lr=0.01",",","grad_clip=30.0",")","#","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.a3c","import","A3CConfig",">",">",">","config","=","A3CConfig","(",")",">",">",">","#","Print","out","some","default","values",".",">",">",">","print","(","config.sample_async",")","#","doctest",":","+SKIP",">",">",">","#","Update","the","config","object",".",">",">",">","config","=","config.training","(","#","doctest",":","+SKIP","...","lr=tune.grid_search","(","[","0.001",",","0.0001","]",")",",","use_critic=False",")",">",">",">","#","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","...","``","A3C","''",",","...","stop=","{","``","episode_reward_mean","''",":","200","}",",","...","param_space=config.to_dict","(",")",",","...",")",".fit","(",")"]
docstr: Sets the training related configuration.
  
  Args:
      lr_schedule: Learning rate schedule. In the format of
          [[timestep, lr-value], [timestep, lr-value], ...]
          Intermediary timesteps will be assigned to interpolated learning rate
          values. A schedule should normally start from timestep 0.
      use_critic: Should use a critic as a baseline (otherwise don't use value
          baseline; required for using GAE).
      use_gae: If true, use the Generalized Advantage Estimator (GAE)
          with a value function, see https://arxiv.org/pdf/1506.02438.pdf.
      lambda_: GAE(gamma) parameter.
      grad_clip: Max global norm for each gradient calculated by worker.
      vf_loss_coeff: Value Function Loss coefficient.
      entropy_coeff: Coefficient of the entropy regularizer.
      entropy_coeff_schedule: Decay schedule for the entropy regularizer.
      sample_async: Whether workers should sample async. Note that this
          increases the effective rollout_fragment_length by up to 5x due
          to async buffering of batches.
  
  Returns:
      This updated AlgorithmConfig object.
docstr_tok: ["Sets","the","training","related","configuration",".","Args",":","lr_schedule",":","Learning","rate","schedule",".","In","the","format","of","[","[","timestep",",","lr-value","]",",","[","timestep",",","lr-value","]",",","...","]","Intermediary","timesteps","will","be","assigned","to","interpolated","learning","rate","values",".","A","schedule","should","normally","start","from","timestep","0.","use_critic",":","Should","use","a","critic","as","a","baseline","(","otherwise","do","n't","use","value","baseline",";","required","for","using","GAE",")",".","use_gae",":","If","true",",","use","the","Generalized","Advantage","Estimator","(","GAE",")","with","a","value","function",",","see","https",":","\/\/arxiv.org\/pdf\/1506.02438.pdf",".","lambda_",":","GAE","(","gamma",")","parameter",".","grad_clip",":","Max","global","norm","for","each","gradient","calculated","by","worker",".","vf_loss_coeff",":","Value","Function","Loss","coefficient",".","entropy_coeff",":","Coefficient","of","the","entropy","regularizer",".","entropy_coeff_schedule",":","Decay","schedule","for","the","entropy","regularizer",".","sample_async",":","Whether","workers","should","sample","async",".","Note","that","this","increases","the","effective","rollout_fragment_length","by","up","to","5x","due","to","async","buffering","of","batches",".","Returns",":","This","updated","AlgorithmConfig","object","."]
code: def training(
      self,
      *,
      lr_schedule: Optional[
          List[List[Union[int, float]]]
      ] = NotProvided,
      use_critic: Optional[bool] = NotProvided,
      use_gae: Optional[bool] = NotProvided,
      lambda_: Optional[float] = NotProvided,
      grad_clip: Optional[float] = NotProvided,
      vf_loss_coeff: Optional[float] = NotProvided,
      entropy_coeff: Optional[float] = NotProvided,
      entropy_coeff_schedule: Optional[
          List[List[Union[int, float]]]
      ] = NotProvided,
      sample_async: Optional[bool] = NotProvided,
      **kwargs,
  ) -> "A3CConfig":
      """Sets the training related configuration.
  
      Args:
          lr_schedule: Learning rate schedule. In the format of
              [[timestep, lr-value], [timestep, lr-value], ...]
              Intermediary timesteps will be assigned to interpolated learning rate
              values. A schedule should normally start from timestep 0.
          use_critic: Should use a critic as a baseline (otherwise don't use value
              baseline; required for using GAE).
          use_gae: If true, use the Generalized Advantage Estimator (GAE)
              with a value function, see https://arxiv.org/pdf/1506.02438.pdf.
          lambda_: GAE(gamma) parameter.
          grad_clip: Max global norm for each gradient calculated by worker.
          vf_loss_coeff: Value Function Loss coefficient.
          entropy_coeff: Coefficient of the entropy regularizer.
          entropy_coeff_schedule: Decay schedule for the entropy regularizer.
          sample_async: Whether workers should sample async. Note that this
              increases the effective rollout_fragment_length by up to 5x due
              to async buffering of batches.
  
      Returns:
          This updated AlgorithmConfig object.
      """
      # Pass kwargs onto super's `training()` method.
      super().training(**kwargs)
  
      if lr_schedule is not NotProvided:
          self.lr_schedule = lr_schedule
      if use_critic is not NotProvided:
          self.lr_schedule = use_critic
      if use_gae is not NotProvided:
          self.use_gae = use_gae
      if lambda_ is not NotProvided:
          self.lambda_ = lambda_
      if grad_clip is not NotProvided:
          self.grad_clip = grad_clip
      if vf_loss_coeff is not NotProvided:
          self.vf_loss_coeff = vf_loss_coeff
      if entropy_coeff is not NotProvided:
          self.entropy_coeff = entropy_coeff
      if entropy_coeff_schedule is not NotProvided:
          self.entropy_coeff_schedule = entropy_coeff_schedule
      if sample_async is not NotProvided:
          self.sample_async = sample_async
  
      return self
  
imports: import logging
  from typing import Any, Dict, List, Optional, Type, Union
  from ray.rllib.algorithms.algorithm import Algorithm
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig, NotProvided
  from ray.rllib.evaluation.rollout_worker import RolloutWorker
  from ray.rllib.policy.policy import Policy
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.metrics import APPLY_GRADS_TIMER, GRAD_WAIT_TIMER, NUM_AGENT_STEPS_SAMPLED, NUM_AGENT_STEPS_TRAINED, NUM_ENV_STEPS_SAMPLED, NUM_ENV_STEPS_TRAINED, SYNCH_WORKER_WEIGHTS_TIMER
  from ray.rllib.utils.metrics.learner_info import LearnerInfoBuilder
  from ray.rllib.utils.typing import ResultDict
label_desc: Use image node_id 2 for calling the A3CConfig obj's underlying member method code with example usage: obj.training() and returns: self