diff options
| author | tslil <tslil@posteo.de> | 2026-09-19 09:59:29 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-09-19 19:23:34 +0100 |
| commit | fe7268110d93e2abe4d4b51ac64e83521a8d6382 (patch) | |
| tree | 68c26f1532e64c498df3a2020c2f4741509e1e39 /src/selfplay.c | |
| parent | 3f918be9b31026ae546f66c565b9494dab6d82a2 (diff) | |
big refactor
* use elo
* optionally train on only diagonal
* train-inference nonlinearity alignment
Diffstat (limited to 'src/selfplay.c')
| -rw-r--r-- | src/selfplay.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 <size> <depth> <min_ply>\n\n\ Plays a single game of <size>x<size>, with <min_ply> moves made randomly. Only the deterministic plies are written to stdout, one JSON record per game, from ply <min_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."; |
