|
io-chess
UCI chess engine
|
Converts neural network WDL outputs to centipawns. More...
#include <algorithm>#include <cmath>

Go to the source code of this file.
Classes | |
| class | WDLConverter |
| Handles conversion between Win-Draw-Loss probabilities and centipawn scores. More... | |
| struct | WDLConverter::WDL |
| Holds Win, Draw, and Loss probabilities. More... | |
Converts neural network WDL outputs to centipawns.
IMPORTANT: This is the INVERSE of WDLNormalizer.hpp's handle_centipawns(). The training formula uses a 0.3 factor that must be accounted for.
Training (WDLNormalizer.hpp): win_rate = sigmoid(cp / SCALE) if cp > 0: w = win_rate, l = (1-w) * 0.3, d = 1 - w - l else: l = 1 - win_rate, w = win_rate * 0.3, d = 1 - l - w
Inverse derivation (this file): We observe that w/(l+w) gives us the key ratio needed to invert. win_ratio = w / (w + l) cp = SCALE * ln(win_ratio / (1 - win_ratio))
Features: