code: def main():
      env = ContinuousCartPoleEnv()
  
      obs_dim = env.observation_space.shape[0]
      act_dim = env.action_space.shape[0]
  
      # 使用PARL框架创建agent
      model = Model(act_dim)
      algorithm = DDPG(
          model,
          gamma=GAMMA,
          tau=TAU,
          actor_lr=ACTOR_LR,
          critic_lr=CRITIC_LR,
      )
      agent = Agent(algorithm, obs_dim, act_dim)
  
      # 创建经验池
      rpm = ReplayMemory(MEMORY_SIZE)
      # 往经验池中预存数据
      while len(rpm) < MEMORY_WARMUP_SIZE:
          run_episode(agent, env, rpm)
  
      episode = 0
      while episode < TRAIN_EPISODE:
          for i in range(50):
              total_reward = run_episode(agent, env, rpm)
              episode += 1
  
          eval_reward = evaluate(env, agent, render=False)
          logger.info(
              "episode:{}    Test reward:{}".format(
                  episode, eval_reward
              )
          )
  
file_path: PARL/examples/tutorials/lesson5/ddpg/train.py
imports: import gym
  import parl
  import paddle
  import gym
  import numpy
  import parl
  from parl.utils import logger
  from agent import Agent
  from model import Model
  from algorithm import DDPG
  from env import ContinuousCartPoleEnv
  from replay_memory import ReplayMemory
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types