Skip to content

Commit 5af09cf

Browse files
snicoletvondele
authored andcommitted
Include pawns in NNUE scaling
We now include the total pawn count in the scaling factor for the output of the NNUE evaluation network. This should have the effect of trying to keep more pawns when SF has the advantage, but exchange them when she is defending. Thanks to Alexander Pagel (Lolligerhans) for the idea of using the value of pawns to ease the comparison with the rest of the material estimation. Passed STC: LLR: 2.93 (-2.94,2.94) {-0.25,1.25} Total: 15072 W: 1700 L: 1539 D: 11833 Ptnml(0-2): 65, 1202, 4845, 1355, 69 https://tests.stockfishchess.org/tests/view/5f7235a63b22d6afa50699b3 Passed LTC: LLR: 2.93 (-2.94,2.94) {0.25,1.25} Total: 25880 W: 1270 L: 1124 D: 23486 Ptnml(0-2): 23, 980, 10788, 1126, 23 https://tests.stockfishchess.org/tests/view/5f723b483b22d6afa5069a99 closes #3164 Bench: 3776081
1 parent 6f0aa18 commit 5af09cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/evaluate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,8 @@ Value Eval::evaluate(const Position& pos) {
10231023
{
10241024
// Scale and shift NNUE for compatibility with search and classical evaluation
10251025
auto adjusted_NNUE = [&](){
1026-
int mat = pos.non_pawn_material();
1027-
return NNUE::evaluate(pos) * (1024 + mat / 32) / 1024 + Tempo;
1026+
int mat = pos.non_pawn_material() + PieceValue[MG][PAWN] * pos.count<PAWN>();
1027+
return NNUE::evaluate(pos) * (720 + mat / 32) / 1024 + Tempo;
10281028
};
10291029

10301030
// If there is PSQ imbalance use classical eval, with small probability if it is small

0 commit comments

Comments
 (0)