From 220a4b79e4b6d742a9ca7c278a1962b870500fbc Mon Sep 17 00:00:00 2001 From: tslil Date: Thu, 10 Sep 2026 14:12:41 +0100 Subject: credit Mitchell Riley: we can drop 65 parameters for about the same strength; also train for longer The idea is that the current model is M_theta(board, ply) = "score for player 0", but we can instead create a different model M'_theta(board) = "score for player 0 assuming that it's player 0's move" and for a certain pair of functions sigma, normalise, recover M_theta(board, ply) = sigma(ply) M'_theta(normalise(board, ply)). This pair of functions is sigma(ply) = +/- 1 (parity), and normalise being a conditional interchange of pieces on the board depending on the parity of the ply. The only things stopping this from being completely straightforward is that nn_train.py evaluates M'_theta itself so we need to pass sigma(ply) to the training loop. 6x6 is still untrained. --- src/match.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/match.c') diff --git a/src/match.c b/src/match.c index 6ae9fa7..459fab5 100644 --- a/src/match.c +++ b/src/match.c @@ -40,7 +40,7 @@ static inline float five_cand(tak_state_p state) { nn_prepare_input(cur_board, state, cand_five_embedding); return eval_net(cur_board, FIVE_INP_NUM, &cand_five_dense_weights[0][0], cand_five_dense_biases, cand_five_logit_weights, cand_five_logit_bias, - FIVE_DENSE_NUM); + FIVE_DENSE_NUM, state->ply & 1 ? 1.0f : -1.0f); } static inline float six_cand(tak_state_p state) { @@ -49,7 +49,7 @@ static inline float six_cand(tak_state_p state) { nn_prepare_input(cur_board, state, cand_six_embedding); return eval_net(cur_board, SIX_INP_NUM, &cand_six_dense_weights[0][0], cand_six_dense_biases, cand_six_logit_weights, cand_six_logit_bias, - SIX_DENSE_NUM); + SIX_DENSE_NUM, state->ply & 1 ? 1.0f : -1.0f); } -- cgit v1.3.1