Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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