diff --git a/source/nnue.cpp b/source/nnue.cpp index 5c7f707..474da29 100644 --- a/source/nnue.cpp +++ b/source/nnue.cpp @@ -187,8 +187,9 @@ int Forward(const Board& board, const Network& net) { return (eval * SCALE) / (QA * QB); } -int16_t Network::Evaluate(const Board& board) { - const int materialScale = 2048 +int16_t Network::Evaluate(const Board& board, bool datagen) { + // Disabled in datagen + const int materialScale = datagen ? 4096 : 2048 + 90 * board.pieces[Knight].PopCount() + 90 * board.pieces[Bishop].PopCount() + 180 * board.pieces[Rook].PopCount() diff --git a/source/nnue.h b/source/nnue.h index 4675d01..d7139cc 100644 --- a/source/nnue.h +++ b/source/nnue.h @@ -33,7 +33,7 @@ constexpr int kingBuckets[2][64] = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, - + { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -45,7 +45,7 @@ constexpr int kingBuckets[2][64] = { 0, 0, 1, 1, 1, 1, 0, 0 } }; - + struct Network { alignas(ALIGNMENT) std::array, INPUT_BUCKETS> accumulator_weights; alignas(ALIGNMENT) std::array accumulator_biases; @@ -54,7 +54,7 @@ struct Network { void Load(const std::string& path); - int16_t Evaluate(const Board& board); + int16_t Evaluate(const Board& board, bool datagen = false); }; inline Network net;