From: Stéphane Nicolet Date: Mon, 28 Sep 2020 20:32:55 +0000 (+0200) Subject: Include pawns in NNUE scaling X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=5af09cfda5b71f9470ef233298e0f4233651337d;ds=sidebyside Include pawns in NNUE scaling We now include the total pawn count in the scaling factor for the output of the NNUE evaluation network. This should have the effect of trying to keep more pawns when SF has the advantage, but exchange them when she is defending. Thanks to Alexander Pagel (Lolligerhans) for the idea of using the value of pawns to ease the comparison with the rest of the material estimation. Passed STC: LLR: 2.93 (-2.94,2.94) {-0.25,1.25} Total: 15072 W: 1700 L: 1539 D: 11833 Ptnml(0-2): 65, 1202, 4845, 1355, 69 https://tests.stockfishchess.org/tests/view/5f7235a63b22d6afa50699b3 Passed LTC: LLR: 2.93 (-2.94,2.94) {0.25,1.25} Total: 25880 W: 1270 L: 1124 D: 23486 Ptnml(0-2): 23, 980, 10788, 1126, 23 https://tests.stockfishchess.org/tests/view/5f723b483b22d6afa5069a99 closes https://github.com/official-stockfish/Stockfish/pull/3164 Bench: 3776081 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index fe92f7d7..25e3bdc1 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -1023,8 +1023,8 @@ Value Eval::evaluate(const Position& pos) { { // Scale and shift NNUE for compatibility with search and classical evaluation auto adjusted_NNUE = [&](){ - int mat = pos.non_pawn_material(); - return NNUE::evaluate(pos) * (1024 + mat / 32) / 1024 + Tempo; + int mat = pos.non_pawn_material() + PieceValue[MG][PAWN] * pos.count(); + return NNUE::evaluate(pos) * (720 + mat / 32) / 1024 + Tempo; }; // If there is PSQ imbalance use classical eval, with small probability if it is small