From 1fbf5b123d880d6629bfdb4ef8536ca57eaa924b Mon Sep 17 00:00:00 2001 From: Christian Fredrik Johnsen Date: Tue, 30 Apr 2024 22:36:36 +0200 Subject: [PATCH] feat: updated main file to support new function for letting alphazero play against mcts. --- main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index ce3d814..84cb0d9 100644 --- a/main.py +++ b/main.py @@ -50,8 +50,8 @@ def train_connect_four(context: GameContext): for i in range(int(1e6)): train_alphazero_model( context=context, - num_games=384, - num_simulations=100, + num_games=20, + num_simulations=200, epochs=3, batch_size=256, ) @@ -63,10 +63,11 @@ def train_connect_four(context: GameContext): def self_play(context: GameContext): alphazero_self_play(context) -def play(context: GameContext, first: bool): +def play(context: GameContext, first: bool, mcts: bool = False): play_vs_alphazero( context=context, - first=first + first=first, + mcts=mcts ) overfit_path = "./models/connect_four/overfit_nn" @@ -102,6 +103,7 @@ def play(context: GameContext, first: bool): # self_play(connect4_context) # play(tic_tac_toe_context, first=False) play(connect4_context, first=False) + # play(connect4_context, first=True, mcts=True) # create_tic_tac_toe_model("initial_test") # create_connect_four_model("overfit_nn")