class_docstr: PPO class
class_docstr_tok: ["PPO","class"]
code: def __init__(
      self, state_dim, action_dim, action_bound, method="clip"
  ):
      # critic
      with tf.name_scope("critic"):
          inputs = tl.layers.Input(
              [None, state_dim], tf.float32, "state"
          )
          layer = tl.layers.Dense(64, tf.nn.relu)(inputs)
          layer = tl.layers.Dense(64, tf.nn.relu)(layer)
          v = tl.layers.Dense(1)(layer)
      self.critic = tl.models.Model(inputs, v)
      self.critic.train()
  
      # actor
      with tf.name_scope("actor"):
          inputs = tl.layers.Input(
              [None, state_dim], tf.float32, "state"
          )
          layer = tl.layers.Dense(64, tf.nn.relu)(inputs)
          layer = tl.layers.Dense(64, tf.nn.relu)(layer)
          a = tl.layers.Dense(action_dim, tf.nn.tanh)(layer)
          mean = tl.layers.Lambda(
              lambda x: x * action_bound, name="lambda"
          )(a)
          logstd = tf.Variable(np.zeros(action_dim, dtype=np.float32))
      self.actor = tl.models.Model(inputs, mean)
      self.actor.trainable_weights.append(logstd)
      self.actor.logstd = logstd
      self.actor.train()
  
      self.actor_opt = tf.optimizers.Adam(LR_A)
      self.critic_opt = tf.optimizers.Adam(LR_C)
  
      self.method = method
      if method == "penalty":
          self.kl_target = KL_TARGET
          self.lam = LAM
      elif method == "clip":
          self.epsilon = EPSILON
  
      self.state_buffer, self.action_buffer = [], []
      self.reward_buffer, self.cumulative_reward_buffer = [], []
      self.action_bound = action_bound
  
file_path: TensorLayer/examples/reinforcement_learning/tutorial_PPO.py
imports: import argparse
  import os
  import time
  import gym
  import matplotlib.pyplot
  import numpy
  import tensorflow
  import tensorflow_probability
  import tensorlayer
label_desc: Use image node_id 1 to create a new PPO object from inherited base classes: object with example: obj = PPO(state_dim, action_dim, action_bound, method)