aboutsummaryrefslogtreecommitdiff
path: root/src/pptdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pptdb.c')
-rw-r--r--src/pptdb.c17
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) {