diff options
| author | tslil <tslil@posteo.de> | 2021-02-11 21:04:42 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 00a04c2929bdc8f8f4bf7d5d8cf413ebfb3cd006 (patch) | |
| tree | 674e3336175b65e8ab9aa132ad1ea7adc124a121 /src/pptdb.c | |
| parent | 890eb8d7f4a8c46eae18283ca5ac9c61fd41ed97 (diff) | |
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.
Diffstat (limited to 'src/pptdb.c')
| -rw-r--r-- | src/pptdb.c | 17 |
1 files changed, 4 insertions, 13 deletions
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<<depth)) ? +0.50 : -0.50; + val = (colours[k] & (1<<depth)) ? +0.75 : -0.75; } } fprintf(training_fh,"%.2f,", val); @@ -136,7 +136,7 @@ parse_line(const char *pt, const ssize_t read) { } // Generate training data, not too early in the game, all // orientations - if (generate && ply + 2 >= 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) { |
