Created
August 23, 2019 15:50
-
-
Save tanzhenyu/c79748f2387d6921a305a7149e7102b5 to your computer and use it in GitHub Desktop.
ppo main loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model, env = ppo() | |
obs = env.reset() | |
reward = 0 | |
while True: | |
action, _, _ = model.get_pi_logpi_vf(obs.reshape(1, -1)) | |
obs, r, d, _ = env.step(action.numpy()[0]) | |
reward += r | |
env.render() | |
if d: | |
print('episode reward {}'.format(reward)) | |
reward = 0 | |
obs = env.reset() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment