1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Simplify material weights in evaluation

This patch uses the same material weights for the nnue
amplification term and the optimism term in evaluate().

STC:
LLR: 2.99 (-2.94,2.94) <-1.75,0.25>
Total: 83360 W: 21489 L: 21313 D: 40558
Ptnml(0-2): 303, 9934, 21056, 10058, 329
https://tests.stockfishchess.org/tests/view/664eee69928b1fb18de500d9

LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 192648 W: 48675 L: 48630 D: 95343
Ptnml(0-2): 82, 21484, 53161, 21501, 96
https://tests.stockfishchess.org/tests/view/664fa17aa86388d5e27d7d6e

closes https://github.com/official-stockfish/Stockfish/pull/5287

Bench: 1495602
This commit is contained in:
Stéphane Nicolet 2024-05-23 22:03:43 +02:00 committed by Disservin
parent 61acbfc7d3
commit 4d876275cf

View file

@ -77,13 +77,10 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
optimism += optimism * nnueComplexity / 512; optimism += optimism * nnueComplexity / 512;
nnue -= nnue * (nnueComplexity * 5 / 3) / 32082; nnue -= nnue * (nnueComplexity * 5 / 3) / 32082;
v = (nnue int material = 200 * pos.count<PAWN>() + 350 * pos.count<KNIGHT>() + 400 * pos.count<BISHOP>()
* (32961 + 381 * pos.count<PAWN>() + 349 * pos.count<KNIGHT>() + 640 * pos.count<ROOK>() + 1200 * pos.count<QUEEN>();
+ 392 * pos.count<BISHOP>() + 649 * pos.count<ROOK>() + 1211 * pos.count<QUEEN>())
+ optimism v = (nnue * (34000 + material) + optimism * (4400 + material)) / 36860;
* (4835 + 136 * pos.count<PAWN>() + 375 * pos.count<KNIGHT>()
+ 403 * pos.count<BISHOP>() + 628 * pos.count<ROOK>() + 1124 * pos.count<QUEEN>()))
/ 36860;
// Damp down the evaluation linearly when shuffling // Damp down the evaluation linearly when shuffling
v = v * (204 - pos.rule50_count()) / 208; v = v * (204 - pos.rule50_count()) / 208;