Skip to content

Commit

Permalink
if not checkmate, continue search
Browse files Browse the repository at this point in the history
  • Loading branch information
netcan committed Jun 22, 2020
1 parent 4c4cf65 commit 933a3c2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pymodule/training/mcts.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ def MCTS_self_play(iter, num_games, chessnet):

encoded_s = board.encode_board()
draw_counter = 0
# for s, _ in reversed(dataset):
# if np.array_equal(encoded_s[:16], s[:16]):
# draw_counter += 1
# if draw_counter >= 3: break
for s, _ in reversed(dataset):
if np.array_equal(encoded_s[:16], s[:16]):
draw_counter += 1
if draw_counter >= 3: break

# if draw_counter >= 3: break
if draw_counter >= 3: break

dataset.append([encoded_s, policy])
print("=============")
Expand All @@ -166,6 +166,7 @@ def MCTS_self_play(iter, num_games, chessnet):
move_count += 1

print("iter {} checkmate {}".format(iter, checkmate))
if not checkmate: continue
dataset_pv = []
for idx, data in enumerate(dataset):
s, p = data
Expand Down

0 comments on commit 933a3c2

Please sign in to comment.