code: def ppo_memorize_digits(
      ctxt=None, seed=1, batch_size=4000, max_episode_length=100
  ):
      """Train PPO on MemorizeDigits-v0 environment.
  
      Args:
          ctxt (garage.experiment.ExperimentContext): The experiment
              configuration used by Trainer to create the snapshotter.
          seed (int): Used to seed the random number generator to produce
              determinism.
          batch_size (int): Number of timesteps to use in each training step.
          max_episode_length (int): Max number of timesteps in an episode.
  
      """
      set_seed(seed)
      with TFTrainer(ctxt) as trainer:
          env = normalize(
              GymEnv(
                  "MemorizeDigits-v0",
                  is_image=True,
                  max_episode_length=max_episode_length,
              )
          )
          policy = CategoricalCNNPolicy(
              env_spec=env.spec,
              filters=(
                  (32, (5, 5)),
                  (64, (3, 3)),
                  (64, (2, 2)),
              ),
              strides=(4, 2, 1),
              padding="VALID",
              hidden_sizes=(256,),
          )  # yapf: disable
  
          baseline = GaussianCNNBaseline(
              env_spec=env.spec,
              filters=(
                  (32, (5, 5)),
                  (64, (3, 3)),
                  (64, (2, 2)),
              ),
              strides=(4, 2, 1),
              padding="VALID",
              hidden_sizes=(256,),
              use_trust_region=True,
          )  # yapf: disable
  
          sampler = RaySampler(
              agents=policy,
              envs=env,
              max_episode_length=env.spec.max_episode_length,
              is_tf_worker=True,
          )
  
          algo = PPO(
              env_spec=env.spec,
              policy=policy,
              baseline=baseline,
              sampler=sampler,
              discount=0.99,
              gae_lambda=0.95,
              lr_clip_range=0.2,
              policy_ent_coeff=0.0,
              optimizer_args=dict(
                  batch_size=32,
                  max_optimization_epochs=10,
                  learning_rate=1e-3,
              ),
          )
  
          trainer.setup(algo, env)
          trainer.train(n_epochs=1000, batch_size=batch_size)
  
file_path: garage/src/garage/examples/tf/ppo_memorize_digits.py
imports: import click
  from garage import wrap_experiment
  from garage.envs import GymEnv, normalize
  from garage.experiment.deterministic import set_seed
  from garage.sampler import RaySampler
  from garage.tf.algos import PPO
  from garage.tf.baselines import GaussianCNNBaseline
  from garage.tf.policies import CategoricalCNNPolicy
  from garage.trainer import TFTrainer
label_desc: Use image node_id 1 for calling a global function with example usage: ppo_memorize_digits(ctxt, seed, batch_size, max_episode_length) without return types