class_docstr: Defines a configuration class from which a PG Algorithm can be built.
  
  Example:
      >>> from rllib_pg.pg import PGConfig
      >>> config = PGConfig().training(lr=0.01).resources(num_gpus=1)
      >>> print(config.to_dict())  # doctest: +SKIP
      >>> # Build a Algorithm object from the config and run 1 training iteration.
      >>> algo = config.build(env="CartPole-v1")  # doctest: +SKIP
      >>> algo.train()  # doctest: +SKIP
  
  Example:
      >>> from rllib_pg.pg import PGConfig
      >>> from ray import air
      >>> from ray import tune
      >>> config = PGConfig()
      >>> # Print out some default values.
      >>> print(config.lr) # doctest: +SKIP
      0.0004
      >>> # Update the config object.
      >>> config = config.training(lr=tune.grid_search([0.001, 0.0001]))
      >>> # Set the config object's env.
      >>> config = config.environment(env="CartPole-v1")
      >>> # Use to_dict() to get the old-style python config dict
      >>> # when running with tune.
      >>> tune.Tuner(  # doctest: +SKIP
      ...     "PG",
      ...     run_config=air.RunConfig(stop={"episode_reward_mean": 200}),
      ...     param_space=config.to_dict(),
      ... ).fit()
docstr: Sets the training related configuration.
  
  Args:
      gamma: Float specifying the discount factor of the Markov Decision process.
      lr: The default learning rate.
      train_batch_size: Training batch size, if applicable.
      model: Arguments passed into the policy model. See models/catalog.py for a
          full list of the available model options.
      optimizer: Arguments to pass to the policy optimizer.
      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.
  
  Returns:
      This updated AlgorithmConfig object.
docstr_tok: ["Sets","the","training","related","configuration",".","Args",":","gamma",":","Float","specifying","the","discount","factor","of","the","Markov","Decision","process",".","lr",":","The","default","learning","rate",".","train_batch_size",":","Training","batch","size",",","if","applicable",".","model",":","Arguments","passed","into","the","policy","model",".","See","models\/catalog.py","for","a","full","list","of","the","available","model","options",".","optimizer",":","Arguments","to","pass","to","the","policy","optimizer",".","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",".","Returns",":","This","updated","AlgorithmConfig","object","."]
code: def training(
      self,
      *,
      lr_schedule: Optional[
          List[List[Union[int, float]]]
      ] = NotProvided,
      **kwargs,
  ) -> "PGConfig":
      """Sets the training related configuration.
  
      Args:
          gamma: Float specifying the discount factor of the Markov Decision process.
          lr: The default learning rate.
          train_batch_size: Training batch size, if applicable.
          model: Arguments passed into the policy model. See models/catalog.py for a
              full list of the available model options.
          optimizer: Arguments to pass to the policy optimizer.
          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.
  
      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
  
      return self
  
file_path: ray/rllib_contrib/pg/src/rllib_pg/pg/pg.py
imports: from typing import List, Optional, Type, Union
  from ray.rllib.algorithms.algorithm import Algorithm
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig, NotProvided
  from ray.rllib.policy.policy import Policy
  from ray.rllib.utils.annotations import override
label_desc: Use image node_id 2 for calling the PGConfig obj's underlying member method code with example usage: obj.training() and returns: self