From 67dd4ba3a9adc6a9db8eb543480e9e82310eeccb Mon Sep 17 00:00:00 2001 From: tslil Date: Tue, 12 Jan 2021 01:15:49 -0500 Subject: Train on data that is close to the end of the game only --- src/ctaklm.c | 2 ++ src/pptdb.c | 32 ++++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ctaklm.c b/src/ctaklm.c index 346b5a5..a5bfe05 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -152,6 +152,8 @@ print_info(void) { printf("Caps remaining: %s%d%s, %s%d%s\n", wht,white_count >> 7,rst, blk,black_count >> 7,rst); + printf("Valuation: %s%.6f%s\n", + blk, evaluate_black_win(), rst); } char *gamelog = 0; diff --git a/src/pptdb.c b/src/pptdb.c index 773962f..35aa325 100644 --- a/src/pptdb.c +++ b/src/pptdb.c @@ -47,8 +47,15 @@ write_input(void) { // Warning: performs _no_ checks on input whatsoever static enum E_RESULT parse_line(const char *pt, const ssize_t read) { - ssize_t idx = 0; + ssize_t idx; enum E_RESULT r; + int total_plies = 0; + + for (idx=0;idx 15) puts("Here"); + /* + * if (current_colour == C_BLACK && ply > 15) puts("Here"); + */ // Generate training data, not too early in the game - if (generate && current_colour == C_BLACK && ply > 15) { + if (generate && current_colour == C_BLACK && ply > total_plies - 5) { write_input(); fprintf(training_fh,"%d,%d\n", result, 1-result); } -- cgit v1.2.3