#include <WDLNormalizer.hpp>
|
| static WDLOutput | convert (const std::string &eval_str, bool is_white_to_move) |
| static float | to_centipawns (const std::string &eval_str, bool is_white_to_move) |
|
| static constexpr float | SCALE = 1.0f / 0.00368208 |
| static constexpr float | MATE_CP = 15000.0f |
WDLNormalizer - Converts eval strings to WDL probabilities.
Uses:
- Sigmoid with SCALE=272 (Lichess constant) for centipawn → win probability
- Side-to-Move perspective (positive = we are winning)
◆ convert()
| WDLOutput WDLNormalizer::convert |
( |
const std::string & | eval_str, |
|
|
bool | is_white_to_move ) |
|
inlinestatic |
Parse eval string into WDL (Side-to-Move perspective).
CSV evals are from White's perspective. This function flips the result when Black is to move, so the output is always from the current player's view.
- Parameters
-
| eval_str | Raw eval string: "35", "-400", "#5", "#-3" |
| is_white_to_move | True if White is the side to move |
- Returns
- WDLOutput with probabilities summing to 1.0 (from STM perspective)
◆ handle_centipawns()
| WDLOutput WDLNormalizer::handle_centipawns |
( |
float | cp | ) |
|
|
inlinestaticprivate |
Convert centipawn score to WDL. Uses logistic sigmoid: P(win) = 1 / (1 + exp(-cp/SCALE))
◆ handle_mate()
| WDLOutput WDLNormalizer::handle_mate |
( |
std::string | s | ) |
|
|
inlinestaticprivate |
Convert mate score to WDL. "#5" = we mate in 5, "#-3" = they mate us in 3.
◆ to_centipawns()
| float WDLNormalizer::to_centipawns |
( |
const std::string & | eval_str, |
|
|
bool | is_white_to_move ) |
|
inlinestatic |
Extract raw centipawns for ExpertRouter (Killer/Survivor thresholds). Returns value from Side-to-Move perspective: positive = STM is winning.
- Parameters
-
| eval_str | Raw eval string |
| is_white_to_move | True if White is to move |
- Returns
- Centipawn value (positive = side to move is winning)
◆ MATE_CP
| float WDLNormalizer::MATE_CP = 15000.0f |
|
staticconstexpr |
◆ SCALE
| float WDLNormalizer::SCALE = 1.0f / 0.00368208 |
|
staticconstexpr |
The documentation for this class was generated from the following file: