Created
July 20, 2019 10:41
-
-
Save NMZivkovic/2602d64e16991d3ef90ed5ce94bbcd4c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
total_epochs, total_penalties = 0, 0 | |
num_of_episodes = 10 | |
enviroment.reset() | |
counter = 0 | |
for e in range(num_of_episodes): | |
state = enviroment.reset() | |
state = img_processor.process_env_state(state) | |
epochs = 0 | |
penalties = 0 | |
reward = 0 | |
total_reward = 0 | |
terminated = False | |
for timesteps in tqdm(range(timesteps_per_episode)): | |
action = agent.act(state) | |
state, reward, terminated, info = enviroment.step(action) | |
state = img_processor.process_env_state(state) | |
if reward == -10: | |
penalties += 1 | |
total_reward += reward | |
epochs += 1 | |
img_processor.save_frame("images/frame_{}.png".format(counter)) | |
counter += 1 | |
total_penalties += penalties | |
total_epochs += epochs | |
img_processor.makegif("images/") | |
print("**********************************") | |
print("Done!") | |
print("**********************************") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment