From ee216c008a188a9436fedb85c70ee5d1719733b1 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Sun, 15 Jan 2023 16:03:37 +0100 Subject: new neural network arch (faster + better) & minor changes + fixes Gone is the convolutional neural network, for it turns out not only is it more difficult to train, but all of the extra information about board layers didn't make much of a difference at this size. So cnn1986 has been replaced by nn1986, a standard, two-layer, dense nn configured as a binary classifier and (mis)used in that capacity. Note: total number of parameters is unchanged. HARK: this new nn exposes a bug somewhere in ctak. Run ctlm with self-play to see the completely borked board state at the end. --- src/cttei.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/cttei.c') diff --git a/src/cttei.c b/src/cttei.c index aae1045..534faef 100644 --- a/src/cttei.c +++ b/src/cttei.c @@ -28,8 +28,8 @@ // Set up output function for negamax inline void negamax_display_progress(const uint8_t cur_depth, - const uint8_t init_depth, - const uint32_t length) { + const uint8_t init_depth, + const uint32_t length) { (void)(cur_depth); (void)(init_depth); (void)(length); @@ -81,7 +81,7 @@ handle_tei(char *line) { enum ACT_RESULT r = do_ptn(negamax_ptn); if (r != ACT_OK && r != GAME_END) return TEI_FAILURE; printf("info score cp %f pv %s\nbestmove %s\n", - minimax, negamax_ptn, negamax_ptn); + minimax, negamax_ptn, negamax_ptn); } else if (!strncmp(line, "position", 8)) { return parse_position_string(line + 9); } else if (!strncmp(line, "teinewgame", 10)) { @@ -126,7 +126,7 @@ int main(int argc, char **argv) { line = NULL; // Identify ourselves, and send the options - puts("id name cttei"); + puts("id name cttei_dense"); puts("id author tslil clingman"); puts("option name Depth type spin default 4 min 2 max 6"); puts("teiok"); @@ -141,15 +141,15 @@ int main(int argc, char **argv) { if ((read = getline(&line, &alloc_size, stdin)) > 0) { line[read-1] = 0; switch (handle_tei(line)) { - case TEI_FAILURE: return EXIT_FAILURE; - case TEI_QUIT: playing = 0; // fall-through - case TEI_OK: { - if (line) { - free(line); - line = NULL; - } - break; - } + case TEI_FAILURE: return EXIT_FAILURE; + case TEI_QUIT: playing = 0; // fall-through + case TEI_OK: { + if (line) { + free(line); + line = NULL; + } + break; + } } } else { break; -- cgit v1.3.1