X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=710898bc15d5929eed398c4dd120e80cf50b3f6a;hp=1503be2d20b902cb2e1e830970fb651c4ea6eb02;hb=1dbd2a1ad548b3ca676f7da949e1a998c64b836b;hpb=f66c381f11b8603e2449b200227c8cfd7382b3ba;ds=sidebyside diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 1503be2d..710898bc 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -1022,7 +1022,10 @@ Value Eval::evaluate(const Position& pos) { else { // Scale and shift NNUE for compatibility with search and classical evaluation - auto adjusted_NNUE = [&](){ return NNUE::evaluate(pos) * 5 / 4 + Tempo; }; + auto adjusted_NNUE = [&](){ + int mat = pos.non_pawn_material(); + return NNUE::evaluate(pos) * (1024 + mat / 32) / 1024 + Tempo; + }; // If there is PSQ imbalance use classical eval, with small probability if it is small Value psq = Value(abs(eg_value(pos.psq_score()))); @@ -1037,7 +1040,7 @@ Value Eval::evaluate(const Position& pos) { // small probability if the classical eval is less than the threshold. if ( largePsq && (abs(v) * 16 < NNUEThreshold2 * r50 - || ( pos.opposite_bishops() + || ( pos.opposite_bishops() && abs(v) * 16 < (NNUEThreshold1 + pos.non_pawn_material() / 64) * r50 && !(pos.this_thread()->nodes & 0xB)))) v = adjusted_NNUE();