some try for policy_gradient

This commit is contained in:
2023-06-01 19:00:56 +08:00
parent be222b4c82
commit 5ccfbeb4e8
5 changed files with 295 additions and 40 deletions
+4 -2
View File
@@ -19,12 +19,14 @@ alphago_rl_agent = PolicyAgent(sl_agent.model.to(device), encoder)
opponent = PolicyAgent(sl_opponent.model.to(device), encoder)
# Run simulation
num_games = 1000
# num_games = 1000
num_games = 10
batch_size = 1024
with tqdm(total=num_games) as pbar:
experience = experience_simulation(num_games, alphago_rl_agent, opponent, progress_callback=lambda: pbar.update(1))
alphago_rl_agent.train(experience)
alphago_rl_agent.train(experience, batch_size=batch_size)
# # Serialize RL agent
# alphago_rl_agent.save('checkpoints/alphago_rl_policy.pt')