From fe7268110d93e2abe4d4b51ac64e83521a8d6382 Mon Sep 17 00:00:00 2001 From: tslil Date: Sat, 19 Sep 2026 09:59:29 +0100 Subject: big refactor * use elo * optionally train on only diagonal * train-inference nonlinearity alignment --- src/selfplay.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/selfplay.c') diff --git a/src/selfplay.c b/src/selfplay.c index b2a5821..37f94fa 100644 --- a/src/selfplay.c +++ b/src/selfplay.c @@ -169,7 +169,8 @@ static int play_game(const uint8_t min_ply, const nn_function fn_1, // final outcome of the played game, from black's perspective const int8_t R = win_value(state->won); - fprintf(stdout, "{\"result\":%d,\"rows\":[", R); + fprintf(stdout, "{\"result\":%d,\"cand_A\":%u,\"cand_B\":%u,\"rows\":[", R, + CAND_A, CAND_B); for (uint32_t k = 0; k < n_rows; k++) { fprintf(stdout, "%s{\"cand\":%u,\"root\":{\"parity\":%d,", k ? "," : "", row_cand_id[k], row_mover_sign[k]); @@ -188,8 +189,8 @@ const char *usage = "selfplay, one game of training data between candidates.\n\n\ Usage: selfplay \n\n\ Plays a single game of x, with moves made randomly. Only the deterministic plies are written to stdout, one JSON record per game, from ply onwards:\n\n\ -\t{\"result\": R, \"rows\": [{\"cand\": id, \"root\": {\"parity\", \"head\", \"cells\"}, \"leaf\": {\"parity\", \"head\", \"cells\", \"terminal\", \"terminal_value\"}}]}\n\n\ -R is the outcome of the game from black's perspective. Each row records the net input of the root state s_t and the PV leaf selected at that ply; the leaf value Net(pv) is taken from the trained net. nn_train.py runs many of these in parallel to generate training data.\n\n\ +\t{\"result\": R, \"cand_A\": i, \"cand_B\": j, \"rows\": [{\"cand\": id, \"root\": {\"parity\", \"head\", \"cells\"}, \"leaf\": {\"parity\", \"head\", \"cells\", \"terminal\", \"terminal_value\"}}]}\n\n\ +R is the outcome of the game from black's perspective; cand_A and cand_B are the ids of the two candidates that played the game. Each row records the net input of the root state s_t and the PV leaf selected at that ply; the leaf value Net(pv) is taken from the trained net. nn_train.py runs many of these in parallel to generate training data.\n\n\ Copyright (C) 2026, tslil clingman\n\n\ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version."; -- cgit v1.3.1