class_docstr: Test class for PPO.
docstr: Test PPO with Pendulum environment.
docstr_tok: ["Test","PPO","with","Pendulum","environment","."]
code: def test_ppo_pendulum(self):
      """Test PPO with Pendulum environment."""
      deterministic.set_seed(0)
      sampler = LocalSampler(
          agents=self.policy,
          envs=self.env,
          max_episode_length=self.env.spec.max_episode_length,
      )
      trainer = Trainer(snapshot_config)
      algo = PPO(
          env_spec=self.env.spec,
          policy=self.policy,
          value_function=self.value_function,
          sampler=sampler,
          discount=0.99,
          gae_lambda=0.97,
          lr_clip_range=2e-1,
      )
  
      trainer.setup(algo, self.env)
      last_avg_ret = trainer.train(n_epochs=10, batch_size=100)
      assert last_avg_ret > 0
  
file_path: garage/tests/garage/torch/algos/test_ppo.py
imports: import pytest
  import torch
  from garage.envs import GymEnv, normalize
  from garage.experiment import deterministic
  from garage.sampler import LocalSampler
  from garage.torch.algos import PPO
  from garage.torch.policies import GaussianMLPPolicy
  from garage.torch.value_functions import GaussianMLPValueFunction
  from garage.trainer import Trainer
  from tests.fixtures import snapshot_config
label_desc: Use image node_id 3 for calling the TestPPO obj's underlying member method code with example usage: obj.test_ppo_pendulum() without return types