mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Avoid calculating nnue complexity twice
Passed non-regression STC: https://tests.stockfishchess.org/tests/view/6697459d4ff211be9d4ec236 LLR: 2.96 (-2.94,2.94) <-1.75,0.25> Total: 146848 W: 38289 L: 38189 D: 70370 Ptnml(0-2): 503, 16665, 39046, 16649, 561 closes https://github.com/official-stockfish/Stockfish/pull/5493 No functional change
This commit is contained in:
parent
c8d8e362fc
commit
c2837769e0
1 changed files with 2 additions and 3 deletions
|
@ -67,18 +67,17 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
|
||||||
: networks.big.evaluate(pos, &caches.big);
|
: networks.big.evaluate(pos, &caches.big);
|
||||||
|
|
||||||
Value nnue = (125 * psqt + 131 * positional) / 128;
|
Value nnue = (125 * psqt + 131 * positional) / 128;
|
||||||
int nnueComplexity = std::abs(psqt - positional);
|
|
||||||
|
|
||||||
// Re-evaluate the position when higher eval accuracy is worth the time spent
|
// Re-evaluate the position when higher eval accuracy is worth the time spent
|
||||||
if (smallNet && (nnue * simpleEval < 0 || std::abs(nnue) < 227))
|
if (smallNet && (nnue * simpleEval < 0 || std::abs(nnue) < 227))
|
||||||
{
|
{
|
||||||
std::tie(psqt, positional) = networks.big.evaluate(pos, &caches.big);
|
std::tie(psqt, positional) = networks.big.evaluate(pos, &caches.big);
|
||||||
nnue = (125 * psqt + 131 * positional) / 128;
|
nnue = (125 * psqt + 131 * positional) / 128;
|
||||||
nnueComplexity = std::abs(psqt - positional);
|
|
||||||
smallNet = false;
|
smallNet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blend optimism and eval with nnue complexity
|
// Blend optimism and eval with nnue complexity
|
||||||
|
int nnueComplexity = std::abs(psqt - positional);
|
||||||
optimism += optimism * nnueComplexity / (smallNet ? 433 : 453);
|
optimism += optimism * nnueComplexity / (smallNet ? 433 : 453);
|
||||||
nnue -= nnue * nnueComplexity / (smallNet ? 18815 : 17864);
|
nnue -= nnue * nnueComplexity / (smallNet ? 18815 : 17864);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue