code: def test_appo_entropy_coeff_schedule(self):
      # Initial lr, doesn't really matter because of the schedule below.
      config = (
          appo.APPOConfig()
          .rollouts(
              num_rollout_workers=1,
              batch_mode="truncate_episodes",
              rollout_fragment_length=10,
          )
          .resources(num_gpus=0)
          .training(
              train_batch_size=20,
              entropy_coeff=0.01,
              entropy_coeff_schedule=[
                  [0, 0.1],
                  [100, 0.01],
                  [300, 0.001],
                  [500, 0.0001],
              ],
          )
          .reporting(
              min_train_timesteps_per_iteration=20,
              # 0 metrics reporting delay, this makes sure timestep,
              # which entropy coeff depends on, is updated after each worker rollout.
              min_time_s_per_iteration=0,
          )
      )
  
      def _step_n_times(algo, n: int):
          """Step Algorithm n times.
  
          Returns:
              learning rate at the end of the execution.
          """
          for _ in range(n):
              results = algo.train()
              print(algo.workers.local_worker().global_vars)
              print(results)
          return results["info"][LEARNER_INFO][DEFAULT_POLICY_ID][
              LEARNER_STATS_KEY
          ]["entropy_coeff"]
  
      for _ in framework_iterator(config, frameworks=("torch", "tf")):
          algo = config.build(env="CartPole-v1")
  
          coeff = _step_n_times(algo, 10)  # 200 timesteps
          # Should be close to the starting coeff of 0.01.
          self.assertLessEqual(coeff, 0.01)
          self.assertGreaterEqual(coeff, 0.001)
  
          coeff = _step_n_times(algo, 20)  # 400 timesteps
          # Should have annealed to the final coeff of 0.0001.
          self.assertLessEqual(coeff, 0.001)
  
          algo.stop()
  
file_path: ray/python/ray/rllib/algorithms/appo/tests/test_appo.py
imports: import unittest
  import ray
  import ray.rllib.algorithms.appo
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
  from ray.rllib.utils.metrics.learner_info import LEARNER_INFO, LEARNER_STATS_KEY
  from ray.rllib.utils.test_utils import check_compute_single_action, check_train_results, framework_iterator
label_desc: Use image node_id 6 for calling the TestAPPO obj's underlying member method code with example usage: obj.test_appo_entropy_coeff_schedule() and returns: results