Reduced time_step

This commit is contained in:
Vasilis Valatsos 2023-11-24 14:55:04 +01:00
parent 1f91ec9d5d
commit 61e7eb5f29
4 changed files with 4 additions and 4 deletions

View file

@ -12,7 +12,7 @@ class Game:
pygame.init() pygame.init()
self.screen = pygame.display.set_mode( self.screen = pygame.display.set_mode(
(WIDTH, HEIGHT), pygame.HIDDEN) (WIDTH, HEIGHT)) # , pygame.HIDDEN)
pygame.display.set_caption('Pneuma') pygame.display.set_caption('Pneuma')

View file

@ -15,7 +15,7 @@ np.random.seed(1)
T.manual_seed(1) T.manual_seed(1)
n_episodes = 10000 n_episodes = 10000
game_len = 20000 game_len = 5000
figure_file = 'plots/score.png' figure_file = 'plots/score.png'
@ -68,14 +68,14 @@ for i in tqdm(range(n_episodes)):
if avg_score[player.player_id] > best_score[player.player_id]: if avg_score[player.player_id] > best_score[player.player_id]:
best_score[player.player_id] = avg_score[player.player_id] best_score[player.player_id] = avg_score[player.player_id]
print(f"Saving models for agent {player.player_id}...") print(f"Saving models for agent {player.player_id}...")
player.agent.save_models(actr_chkpt = f"player_{player.player_id}_actor", crtc_chkpt = f"player_{player.player_id}_critic") player.agent.save_models(
actr_chkpt=f"player_{player.player_id}_actor", crtc_chkpt=f"player_{player.player_id}_critic")
print("Models saved ...\n") print("Models saved ...\n")
print( print(
f"\nCumulative score for player {player.player_id}: {score_history[0][i]}\nAverage score for player {player.player_id}: {avg_score[player.player_id]}\nBest score for player {player.player_id}: {best_score[player.player_id]}") f"\nCumulative score for player {player.player_id}: {score_history[0][i]}\nAverage score for player {player.player_id}: {avg_score[player.player_id]}\nBest score for player {player.player_id}: {best_score[player.player_id]}")
plt.plot(score_history[0]) plt.plot(score_history[0])
game.quit() game.quit()

Binary file not shown.

Binary file not shown.