string currentEvalFileName = "None";
- static double to_cp(Value v) { return double(v) / UCI::NormalizeToPawnValue; }
-
/// NNUE::init() tries to load a NNUE network at startup time, or when the engine
/// receives a UCI command "setoption name EvalFile value nn-[a-z0-9]{12}.nnue"
/// The name of the NNUE network is always retrieved from the EvalFile option.
assert(!pos.checkers());
Value v;
- Value psq = pos.psq_eg_stm();
int nnueComplexity;
int npm = pos.non_pawn_material() / 64;
Value nnue = NNUE::evaluate(pos, true, &nnueComplexity);
+ int material = 67 * (pos.count<PAWN>(stm) - pos.count<PAWN>(~stm))
+ + 395 * (pos.count<KNIGHT>(stm) - pos.count<KNIGHT>(~stm))
+ + 288 * (pos.count<BISHOP>(stm) - pos.count<BISHOP>(~stm))
+ + 630 * (pos.count<ROOK>(stm) - pos.count<ROOK>(~stm))
+ + 857 * (pos.count<QUEEN>(stm) - pos.count<QUEEN>(~stm));
+
// Blend optimism with nnue complexity and (semi)classical complexity
- optimism += optimism * (nnueComplexity + abs(psq - nnue)) / 512;
+ optimism += optimism * (nnueComplexity + abs(material - nnue)) / 512;
v = ( nnue * (915 + npm + 9 * pos.count<PAWN>())
+ optimism * (154 + npm + pos.count<PAWN>())) / 1024;
Value v;
v = NNUE::evaluate(pos, false);
v = pos.side_to_move() == WHITE ? v : -v;
- ss << "NNUE evaluation " << to_cp(v) << " (white side)\n";
+ ss << "NNUE evaluation " << 0.01 * UCI::to_cp(v) << " (white side)\n";
v = evaluate(pos);
v = pos.side_to_move() == WHITE ? v : -v;
- ss << "Final evaluation " << to_cp(v) << " (white side)";
+ ss << "Final evaluation " << 0.01 * UCI::to_cp(v) << " (white side)";
ss << " [with scaled NNUE, ...]";
ss << "\n";