From 11956b2e940f5e1839efab187d898092e819a766 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Mon, 1 Feb 2021 21:46:24 -0500 Subject: Tried some naive iterative deepening. Work on TEI interface next If TEI is implemented, then i could make use of Morten's racetrack (https://github.com/MortenLohne/racetrack) and develop a quantitative measure of the bot's performance. This is the current priority. --- src/pptdb.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/pptdb.c') diff --git a/src/pptdb.c b/src/pptdb.c index 557b894..e3fd687 100644 --- a/src/pptdb.c +++ b/src/pptdb.c @@ -32,7 +32,7 @@ int generate, outcome_black; const int max_depth = 6; static void -write_input(const int dx, const int dy) { +write_input(const int dx, const int dy, const uint8_t swap) { // Two numbers for flats remaining fprintf(training_fh,"%.8f,%.8f,", (float)(white_count & 127)/max_flats, @@ -48,7 +48,8 @@ write_input(const int dx, const int dy) { col = (dx>0)?-1:board_size; for (int j = 0; j < board_size; j++) { col += dx; - const uint8_t k = THE_COORDS(col, row); + const uint8_t k = + (swap) ? THE_COORDS(row, col) : THE_COORDS(col, row); val = 0; if (COUNT_AT(k)>depth) { if (depth == 0) { @@ -136,10 +137,10 @@ parse_line(const char *pt, const ssize_t read) { // Generate training data, not too early in the game, all // orientations if (generate && ply + 4 >= total_plies) { - write_input(-1,-1); - write_input(-1,+1); - write_input(+1,-1); - write_input(+1,+1); + write_input(-1, -1, 0); write_input(-1, -1, 1); + write_input(-1, +1, 0); write_input(-1, +1, 1); + write_input(+1, -1, 0); write_input(+1, -1, 1); + write_input(+1, +1, 0); write_input(+1, +1, 1); } // Parse next action while (idx