MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / finish_path

Method finish_path

examples/reinforcement_learning/tutorial_TRPO.py:425–437  ·  view source on GitHub ↗

finish a trajectory :param done: whether the epoch is done :param next_state: next state :return: None

(self, done, next_state)

Source from the content-addressed store, hash-verified

423 self.train_vf(states, rewards_to_go)
424
425 def finish_path(self, done, next_state):
426 """
427 finish a trajectory
428 :param done: whether the epoch is done
429 :param next_state: next state
430 :return: None
431 """
432 if not done:
433 next_state = np.array([next_state], np.float32)
434 last_val = self.critic(next_state)
435 else:
436 last_val = 0
437 self.buf.finish_path(last_val)
438
439
440if __name__ == '__main__':

Callers 1

tutorial_TRPO.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected