1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Try to match relative magnitude of NNUE eval to classical

The idea is that since we are mixing NNUE and classical evals matching their magnitudes closer allows for better comparisons.

STC https://tests.stockfishchess.org/tests/view/5f35a65411a9b1a1dbf18e2b
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 9840 W: 1150 L: 1027 D: 7663
Ptnml(0-2): 49, 772, 3175, 855, 69

LTC https://tests.stockfishchess.org/tests/view/5f35bcbe11a9b1a1dbf18e47
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 44424 W: 2492 L: 2294 D: 39638
Ptnml(0-2): 42, 2015, 17915, 2183, 57

also corrects the location to clamp the evaluation (non-function on bench).

closes https://github.com/official-stockfish/Stockfish/pull/3003

bench: 3905447
This commit is contained in:
mstembera 2020-08-14 04:49:33 -07:00 committed by Joost VandeVondele
parent e5f450cf0b
commit 6eb186c97e
2 changed files with 5 additions and 5 deletions

View file

@ -941,11 +941,14 @@ Value Eval::evaluate(const Position& pos) {
bool classical = !Eval::useNNUE
|| abs(eg_value(pos.psq_score())) >= NNUEThreshold;
Value v = classical ? Evaluation<NO_TRACE>(pos).value()
: NNUE::evaluate(pos) + Tempo;
: NNUE::evaluate(pos) * 5 / 4 + Tempo;
// Damp down the evaluation linearly when shuffling
v = v * (100 - pos.rule50_count()) / 100;
// Guarantee evalution outside of TB range
v = Utility::clamp(v, VALUE_TB_LOSS_IN_MAX_PLY + 1, VALUE_TB_WIN_IN_MAX_PLY - 1);
return v;
}

View file

@ -159,10 +159,7 @@ namespace Eval::NNUE {
// Evaluation function. Perform differential calculation.
Value evaluate(const Position& pos) {
Value v = ComputeScore(pos, false);
v = Utility::clamp(v, VALUE_TB_LOSS_IN_MAX_PLY + 1, VALUE_TB_WIN_IN_MAX_PLY - 1);
return v;
return ComputeScore(pos, false);
}
// Evaluation function. Perform full calculation.