From 00a04c2929bdc8f8f4bf7d5d8cf413ebfb3cd006 Mon Sep 17 00:00:00 2001 From: tslil Date: Thu, 11 Feb 2021 21:04:42 -0500 Subject: Don't generate header for training data + tweaks For some reason it would seem that moving flats to a lower value and increasing the proximity between caps and top flats improves acquisition. Still not great, but every bit counts. --- src/pptdb.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/pptdb.c b/src/pptdb.c index 286678d..8684c47 100644 --- a/src/pptdb.c +++ b/src/pptdb.c @@ -53,18 +53,18 @@ write_input(const int dx, const int dy, const uint8_t swap) { val = 0; if (COUNT_AT(k)>depth) { if (depth == 0) { - // Top layer of stacks is handled differently to indicate + // Top layer of stacks is handled differently to indicate // stone type if (STONE_AT(k) == STONE_STANDING) { val = (colours[k] & 1) ? +0.25 : -0.25; } else if (STONE_AT(k) == STONE_CAPSTONE) { val = (colours[k] & 1) ? +1.00 : -1.00; } else { - val = (colours[k] & 1) ? +0.50 : -0.50; + val = (colours[k] & 1) ? +0.75 : -0.75; } } else { // Layers underneath - val = (colours[k] & (1<= total_plies) { + if (generate && ply + 3 >= total_plies) { #define RANDPM1 ((rand()&1)?-1:+1) write_input(RANDPM1, RANDPM1, rand()&1); } @@ -181,15 +181,6 @@ int main(int argc, char **argv) { snprintf(td_fn, 64, "data/training-%d.csv",size); training_fh = fopen(td_fn, "w"); if (training_fh == NULL) exit(EXIT_FAILURE); - - // Write header - fputs("\"White flats\",\"Black flats\",",training_fh); - for (int depth = 0; depth < max_depth; depth++) { - for (int k = 0; k < size*size; k++) { - fprintf(training_fh,"\"Stack %d %d\",",depth,k); - } - } - fputs("\"Outcome\"\n",training_fh); } else generate=0; while ((read = getline(&line, &len, playtak_fh)) != -1) { -- cgit v1.2.3