diff options
| author | tslil <tslil@posteo.de> | 2026-09-03 20:17:22 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-09-04 21:03:59 +0100 |
| commit | 1ca3309dad9d412870b2b793f33af7a7ccabd514 (patch) | |
| tree | 15ce96557f04a7eded89193f12065dcd64c33ec8 /include/negamax.h | |
| parent | f11793dc0fddfcaad04b89827634cbb40fa98e59 (diff) | |
TD-leaf and another negamax bug
TD-lambda and TD-leaf are separated by the observation that minimax with a parameterised leaf heuristic is differentiable* in the parameters. "All" that had to be done was to extract the "principal variation": which one position survived all of the pruning to become the reported value.
This was a bit fiddly and uncovered a subtle bug (again) in negamax.c: we were not being complete in our overriding of the TT entry and by omitting key it was possible that later searches would find incorrect values.
The more interesting question to me was: how do we introduce enough variety while not corrupting the PV chain? I settled on having selfplay have one of the players be epsilon-random but the other greedy (minimax) and simply report only the greedy portion PV chain. This appears to work well enough in practice and doesn't introduce nonsense training data for the net (we don't force its actions to be nonsensical). I also deciced, perhaps in a departure from tradition, that we had good supervised labels for PVs that happened to be winning states, so the training overrides the targets in that case. Finally rolled back some of the ambition in nn_train.py default arguments.
*almost always
Diffstat (limited to 'include/negamax.h')
| -rw-r--r-- | include/negamax.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/negamax.h b/include/negamax.h index 78ed448..7b32233 100644 --- a/include/negamax.h +++ b/include/negamax.h @@ -32,6 +32,9 @@ extern const float infty; extern char negamax_ptn[9]; extern uint8_t negamax_search_depth; +// Limited by the per-level action scratch buffers in actions.c. +#define NEGAMAX_MAX_DEPTH 8 + extern void negamax_display_progress(const uint8_t cur_depth, const uint8_t init_depth, const uint32_t length); |
