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=act_dim, obs_dim=obs_dim)
      algorithm = DDPG(
          model,
          gamma=GAMMA,
          tau=TAU,
          actor_lr=ACTOR_LR,
          critic_lr=CRITIC_LR,
      )
      agent = Agent(algorithm, act_dim, expl_noise=NOISE)
  
      # 创建经验池
      rpm = ReplayMemory(MEMORY_SIZE)
      # 往经验池中预存数据
      while len(rpm) < MEMORY_WARMUP_SIZE:
          run_train_episode(agent, env, rpm)
  
      episode = 0
      while episode < TRAIN_EPISODE:
          for i in range(100):
              total_reward = run_train_episode(agent, env, rpm)
              episode += 1
  
          eval_reward = run_evaluate_episodes(agent, env, render=False)
          logger.info(
              "episode:{}    Test reward:{}".format(
                  episode, eval_reward
              )
          )
  
file_path: PARL/examples/tutorials/parl2_dygraph/lesson5/ddpg/train.py
imports: import gym
  import parl
  import paddle
  import numpy
  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