code: def build_program(self):
      self.predict_programs = []
      self.predict_outputs = []
      self.learn_programs = []
      self.learn_programs_output = []
      for i in range(self.ensemble_num):
          predict_program = fluid.Program()
          with fluid.program_guard(predict_program):
              obs = layers.data(
                  name="obs", shape=[self.obs_dim], dtype="float32"
              )
              act = self.alg.predict(obs, model_id=i)
          self.predict_programs.append(predict_program)
          self.predict_outputs.append([act.name])
  
          learn_program = fluid.Program()
          with fluid.program_guard(learn_program):
              obs = layers.data(
                  name="obs", shape=[self.obs_dim], dtype="float32"
              )
              act = layers.data(
                  name="act", shape=[self.act_dim], dtype="float32"
              )
              reward = layers.data(
                  name="reward", shape=[], dtype="float32"
              )
              next_obs = layers.data(
                  name="next_obs", shape=[self.obs_dim], dtype="float32"
              )
              terminal = layers.data(
                  name="terminal", shape=[], dtype="bool"
              )
              actor_lr = layers.data(
                  name="actor_lr",
                  shape=[1],
                  dtype="float32",
                  append_batch_size=False,
              )
              critic_lr = layers.data(
                  name="critic_lr",
                  shape=[1],
                  dtype="float32",
                  append_batch_size=False,
              )
              actor_loss, critic_loss = self.alg.learn(
                  obs,
                  act,
                  reward,
                  next_obs,
                  terminal,
                  actor_lr,
                  critic_lr,
                  model_id=i,
              )
          self.learn_programs.append(learn_program)
          self.learn_programs_output.append([critic_loss.name])
  
      self.ensemble_predict_program = fluid.Program()
      with fluid.program_guard(self.ensemble_predict_program):
          obs = layers.data(
              name="obs", shape=[self.obs_dim], dtype="float32"
          )
          act = self.alg.ensemble_predict(obs)
      self.ensemble_predict_output = [act.name]
  
file_path: PARL/examples/NeurIPS2018-AI-for-Prosthetics-Challenge/opensim_agent.py
imports: import numpy
  import re
  import parl
  from parl import layers
  from paddle import fluid
  from paddle.fluid.executor import _fetch_var
  from parl.utils import logger
label_desc: Use image node_id 2 for calling the OpenSimAgent obj's underlying member method code with example usage: obj.build_program() without return types