Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	DeepCrazyhouse/src/domain/agent/NeuralNetAPI.py
#	DeepCrazyhouse/src/domain/agent/player/MCTSAgent.py
#	DeepCrazyhouse/src/domain/agent/player/_Agent.py
#	DeepCrazyhouse/src/domain/agent/player/util/NetPredService.py
#	DeepCrazyhouse/src/domain/agent/player/util/Node.py
#	DeepCrazyhouse/src/samples/MCTS_eval_demo.ipynb
#	crazyara.py
  • Loading branch information
QueensGambit committed Dec 26, 2018
2 parents ddbc816 + d0bca60 commit 246bc23
Show file tree
Hide file tree
Showing 10 changed files with 515 additions and 199 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,9 @@ main_config.py

# avoid pushing log-files generated by uci-communication
CrazyAra-log.txt
score-log.txt

# avoid pushing dataset files used for visualization
crazyara_lichess_dataset.pgn
crazyara_lichess_dataset_stats.csv

196 changes: 0 additions & 196 deletions CrazyAra-log-bug.txt

This file was deleted.

31 changes: 31 additions & 0 deletions DeepCrazyhouse/src/preprocessing/PGN2PlanesConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,37 @@ def _filter_pgn_thread(self, queue, pgn):
queue.put(batch_black_won)
queue.put(batch_draw)

def filter_all_pgns(self):
"""
Filters out all games based on the given conditions in the constructor and returns all games in
:return: lst_all_pgn_sel: List of selected games in String-IO format
lst_nb_games_sel: Number of selected games for each pgn file
lst_batch_white_won: Number of white wins in each pgn file
lst_black_won: Number of black wins in each pgn file
lst_draw_won: Number of draws in each pgn file
"""

total_games_exported = 0

lst_all_pgn_sel = []
lst_nb_games_sel = []
lst_batch_white_won = []
lst_batch_black_won = []
lst_batch_draw = []

pgns = os.listdir(self._import_dir)
for pgn_name in pgns:
self._pgn_name = pgn_name
all_pgn_sel, nb_games_sel, batch_white_won, batch_black_won, batch_draw = self.filter_pgn()
lst_all_pgn_sel.append(all_pgn_sel)
lst_nb_games_sel.append(nb_games_sel)
lst_batch_white_won.append(batch_white_won)
lst_batch_black_won.append(batch_black_won)
lst_batch_draw.append(batch_draw)

return lst_all_pgn_sel, lst_nb_games_sel, lst_batch_white_won, lst_batch_black_won, lst_batch_draw


def convert_all_pgns_to_planes(self):
"""
Master function which calls convert_pgn_to_planes() for all available pgns in the import directory
Expand Down
Loading

0 comments on commit 246bc23

Please sign in to comment.