Skip to content

Commit

Permalink
feat: updated main file to support new function for letting alphazero…
Browse files Browse the repository at this point in the history
… play against mcts.
  • Loading branch information
ChristianFredrikJohnsen committed Apr 30, 2024
1 parent 463270f commit 1fbf5b1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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"
Expand Down Expand Up @@ -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")

0 comments on commit 1fbf5b1

Please sign in to comment.