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()
code: def validate(self) -> None:
      # Call super's validation method.
      super().validate()
  
      # Synchronous sampling, on-policy PG algo -> Check mismatches between
      # `rollout_fragment_length` and `train_batch_size` to avoid user confusion.
      self.validate_train_batch_size_vs_rollout_fragment_length()
  
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 3 for calling the PGConfig obj's underlying member method code with example usage: obj.validate() without return types