From: Fabian Fichter Date: Tue, 22 Dec 2020 22:58:28 +0000 (+0100) Subject: Check bonus on top of NNUE evaluation for 3check X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=4a1545957c4ac26295a1b24954e9bc496f2aeed0;p=fairystockfish.git Check bonus on top of NNUE evaluation for 3check In order to compensate for the lack for check counts in the input features of the NNUE evaluation, add an additional evaluation term on top of it. 3check STC Score of patch vs master: 114 - 73 - 13 [0.603] 200 Elo difference: 72.2 +/- 47.8, LOS: 99.9 %, DrawRatio: 6.5 % 3check LTC Score of patch vs master: 105 - 79 - 16 [0.565] 200 Elo difference: 45.4 +/- 46.8, LOS: 97.2 %, DrawRatio: 8.0 % --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 9f22d43..8b16477 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -1494,7 +1494,14 @@ 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() + PawnValueMg * pos.count(); - return NNUE::evaluate(pos) * (679 + mat / 32) / 1024 + Tempo; + int v2 = VALUE_ZERO; + if (pos.check_counting()) + { + Color us = pos.side_to_move(); + v2 = mat / (30 * pos.checks_remaining( us)) + - mat / (30 * pos.checks_remaining(~us)); + } + return NNUE::evaluate(pos) * (679 + mat / 32) / 1024 + Tempo + v2; }; // If there is PSQ imbalance use classical eval, with small probability if it is small