From 328c8d1e3094a942d6a2edd933c9cc4ab09daab1 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Sun, 31 Jan 2021 23:33:39 -0500 Subject: Just some #weightgoals ;) It turns out that while i was training on a 0/1 classification problem, i was using 2*eval - 1. Training using this function instead, and on bot-dominated game choices (chosen_player in extract.sh) seems to have given a better evaluation function. At the least, Morten's swindle doesn't work anymore. --- include/cnn1986.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/cnn1986.c') diff --git a/include/cnn1986.c b/include/cnn1986.c index d4f6ad6..b95fca1 100644 --- a/include/cnn1986.c +++ b/include/cnn1986.c @@ -100,13 +100,13 @@ float cnn1986_evaluate_black_win(void) { for (uint8_t d2 = 0; d2 < DENSE2_NUM; d2++) { output += dense2[d2]*output_weights[d2]; } - // Truncated Pade approximant of logistic function - output = (12.0+output+50.0*output/(output*output+10.0))/24.0; + // 2*(clamped Pade approximant of logistic function) - 1 + output = (12.0+output+50.0*output/(output*output+10.0))/12.0 - 1.0; if (output > 1.0) { return 1.0; } - else if (output < 0.0) { + else if (output < -1.0) { return -1.0; } - return 2*output-1.0; + return output; } -- cgit v1.3.1