def run(self, PER_memory, gaussian_noise, run_agent_event, stop_agent_event): # Continuously run agent in environment to collect experiences and add to replay memory(在环境中持续运行代理以收集体验并添加到重播内存) # Initialise deque buffer to store experiences for N-step returns(初始化双步缓冲区以存储 N 步返回的经验) self.exp_buffer = deque() # Perform initial copy of params from learner to agent(执行从learner到代理的参数的初始复制) self.sess.run(self.update_op) # Initialise var for logging episode reward if train_params.LOG_DIR is not None: self.sess.run(self.init_reward_var) # Initially set threading event to allow agent to run until told otherwise run_agent_event.set() num_eps = 0
时间: 2024-02-10 10:33:27 浏览: 119
run_remove_noise6.rar_NOISE_reduce noise matlab
这段代码看起来像是一个强化学习算法中的智能体代理程序,它通过与环境交互来收集经验并将其存储在重播内存中,用于N步返回。在运行之前,它会将参数从学习器复制到代理中。它还初始化了一个变量来记录每个episode的奖励,并设置了一个线程事件,以允许代理程序一直运行直到有其他指示。最后,它记录了运行的episode数量。
阅读全文