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

Lower smallnet threshold with tuned eval params

The smallnet threshold is now below the training data range
of the current smallnet (simple eval diff > 1k, nn-baff1edelf90.nnue)
when no pawns are on the board.

Params found with spsa at 93k / 120k games at 60+06:
https://tests.stockfishchess.org/tests/view/664fa166a86388d5e27d7d6b

Tuned on top of: https://github.com/official-stockfish/Stockfish/pull/5287

Passed STC:
https://tests.stockfishchess.org/tests/view/664fc8b7a86388d5e27d8dac
LLR: 2.96 (-2.94,2.94) <0.00,2.00>
Total: 64672 W: 16731 L: 16371 D: 31570
Ptnml(0-2): 239, 7463, 16517, 7933, 184

Passed LTC:
https://tests.stockfishchess.org/tests/view/664fd5f9a86388d5e27d8dfe
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 210648 W: 53489 L: 52813 D: 104346
Ptnml(0-2): 102, 23129, 58164, 23849, 80

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

Bench: 1717838
This commit is contained in:
Linmiao Xu 2024-05-24 10:58:13 -04:00 committed by Disservin
parent 4d876275cf
commit 8bc3fd3871

View file

@ -46,7 +46,7 @@ int Eval::simple_eval(const Position& pos, Color c) {
bool Eval::use_smallnet(const Position& pos) { bool Eval::use_smallnet(const Position& pos) {
int simpleEval = simple_eval(pos, pos.side_to_move()); int simpleEval = simple_eval(pos, pos.side_to_move());
return std::abs(simpleEval) > 1018 + 5 * pos.count<PAWN>(); return std::abs(simpleEval) > 992 + 6 * pos.count<PAWN>();
} }
// Evaluate is the evaluator for the outer world. It returns a static evaluation // Evaluate is the evaluator for the outer world. It returns a static evaluation
@ -74,13 +74,15 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
} }
// Blend optimism and eval with nnue complexity // Blend optimism and eval with nnue complexity
optimism += optimism * nnueComplexity / 512; optimism += optimism * nnueComplexity / 470;
nnue -= nnue * (nnueComplexity * 5 / 3) / 32082; nnue -= nnue * (nnueComplexity * 5 / 3) / 32621;
int material = 200 * pos.count<PAWN>() + 350 * pos.count<KNIGHT>() + 400 * pos.count<BISHOP>() int material = 200 * pos.count<PAWN>() + 350 * pos.count<KNIGHT>() + 400 * pos.count<BISHOP>()
+ 640 * pos.count<ROOK>() + 1200 * pos.count<QUEEN>(); + 640 * pos.count<ROOK>() + 1200 * pos.count<QUEEN>();
v = (nnue * (34000 + material) + optimism * (4400 + material)) / 36860; v = (nnue * (34000 + material + 135 * pos.count<PAWN>())
+ optimism * (4400 + material + 99 * pos.count<PAWN>()))
/ 35967;
// 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;