Skip to content

Commit

Permalink
Use same nnue divisor for both nets
Browse files Browse the repository at this point in the history
Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/6643ceeabc537f56194506f6
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 224800 W: 57910 L: 57896 D: 108994
Ptnml(0-2): 673, 26790, 57519, 26686, 732

Passed non-regression LTC:
https://tests.stockfishchess.org/tests/view/6643ff15bc537f5619451719
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 347658 W: 87574 L: 87688 D: 172396
Ptnml(0-2): 207, 39004, 95488, 38956, 174

closes #5250

Bench: 1804704
  • Loading branch information
linrock authored and Disservin committed May 16, 2024
1 parent dcb0233 commit 541406a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
smallNet = false;
}

const auto adjustEval = [&](int nnueDiv, int pawnCountMul, int shufflingConstant) {
const auto adjustEval = [&](int pawnCountMul, int shufflingConstant) {
// Blend optimism and eval with nnue complexity and material imbalance
optimism += optimism * (nnueComplexity + std::abs(simpleEval - nnue)) / 584;
nnue -= nnue * (nnueComplexity * 5 / 3) / nnueDiv;
nnue -= nnue * (nnueComplexity * 5 / 3) / 32395;

int npm = pos.non_pawn_material() / 64;
v = (nnue * (npm + 943 + pawnCountMul * pos.count<PAWN>()) + optimism * (npm + 140)) / 1058;
Expand All @@ -82,9 +82,9 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
};

if (!smallNet)
adjustEval(32395, 11, 178);
adjustEval(11, 178);
else
adjustEval(32793, 9, 206);
adjustEval(9, 206);

// Guarantee evaluation does not hit the tablebase range
v = std::clamp(v, VALUE_TB_LOSS_IN_MAX_PLY + 1, VALUE_TB_WIN_IN_MAX_PLY - 1);
Expand Down

0 comments on commit 541406a

Please sign in to comment.