X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fnnue%2Fevaluate_nnue.cpp;h=862b200338888a908716d191e0f8152d89e23b4a;hb=ad926d34c0105d523bfa5cb92cbcf9f337d54c08;hp=bd473294d159013ca7fb5eec2e48d376e397cae6;hpb=64f21ecdae0402bfde4e9f4e61097c99bcae343e;p=stockfish diff --git a/src/nnue/evaluate_nnue.cpp b/src/nnue/evaluate_nnue.cpp index bd473294..862b2003 100644 --- a/src/nnue/evaluate_nnue.cpp +++ b/src/nnue/evaluate_nnue.cpp @@ -1,6 +1,6 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 - Copyright (C) 2004-2021 The Stockfish developers (see AUTHORS file) + Copyright (C) 2004-2022 The Stockfish developers (see AUTHORS file) Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -165,12 +165,11 @@ namespace Stockfish::Eval::NNUE { const auto psqt = featureTransformer->transform(pos, transformedFeatures, bucket); const auto positional = network[bucket]->propagate(transformedFeatures, buffer)[0]; - // Give more value to positional evaluation when material is balanced - if ( adjusted - && abs(pos.non_pawn_material(WHITE) - pos.non_pawn_material(BLACK)) <= RookValueMg - BishopValueMg) - return static_cast(((128 - delta) * psqt + (128 + delta) * positional) / 128 / OutputScale); + // Give more value to positional evaluation when adjusted flag is set + if (adjusted) + return static_cast(((128 - delta) * psqt + (128 + delta) * positional) / 128 / OutputScale); else - return static_cast((psqt + positional) / OutputScale); + return static_cast((psqt + positional) / OutputScale); } struct NnueEvalTrace {