From 890eb8d7f4a8c46eae18283ca5ac9c61fd41ed97 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Wed, 10 Feb 2021 20:07:24 -0500 Subject: Change the training data generation a little Although it pains me to say it, ``label smoothing'' appears to be actually work. I'm also currently experimenting with training simply against _all_ games, instead of only bot matches. Once the training finishes i'll pit cttei against itself with old and new weights, hopefully there'll be a noticeable improvement. --- src/pptdb.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/pptdb.c b/src/pptdb.c index bb94987..286678d 100644 --- a/src/pptdb.c +++ b/src/pptdb.c @@ -24,10 +24,10 @@ #include -float max_flats; +int generate; uint64_t heights[16]; FILE *training_fh = NULL; -int generate, outcome_black; +float max_flats, outcome_black; const int max_depth = 6; @@ -71,7 +71,7 @@ write_input(const int dx, const int dy, const uint8_t swap) { } } } - fprintf(training_fh,"%d\n", outcome_black); + fprintf(training_fh,"%.1f\n", outcome_black); } // Warning: performs _no_ checks on input whatsoever @@ -136,11 +136,9 @@ 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, 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); + if (generate && ply + 2 >= total_plies) { +#define RANDPM1 ((rand()&1)?-1:+1) + write_input(RANDPM1, RANDPM1, rand()&1); } // Parse next action while (idx