4 king input buckets in the net

bench: 1311861
This commit is contained in:
rektdie committed 2026-03-31 14:34:29 +02:00
1 parent 1f2bb52418
commit 454d9e61c1
7 files changed
+85 -35

No files matched your search

+26 -1
View File
@@ -15,14 +15,39 @@ namespace NNUE {
constexpr size_t INPUT_SIZE = 768;
constexpr size_t HL_SIZE = 1536;
constexpr size_t INPUT_BUCKETS = 4;
constexpr size_t OUTPUT_BUCKETS = 8;
constexpr int16_t SCALE = 400;
constexpr int16_t QA = 255;
constexpr int16_t QB = 64;
constexpr int kingBuckets[2][64] = {
{
0, 0, 1, 1, 1, 1, 0, 0,
2, 2, 2, 2, 2, 2, 2, 2,
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,
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,
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,
2, 2, 2, 2, 2, 2, 2, 2,
0, 0, 1, 1, 1, 1, 0, 0
}
};
struct Network {
alignas(ALIGNMENT) std::array<int16_t, HL_SIZE * INPUT_SIZE> accumulator_weights;
alignas(ALIGNMENT) std::array<std::array<int16_t, HL_SIZE * INPUT_SIZE>, INPUT_BUCKETS> accumulator_weights;
alignas(ALIGNMENT) std::array<int16_t, HL_SIZE> accumulator_biases;
alignas(ALIGNMENT) std::array<std::array<int16_t, 2 * HL_SIZE>, OUTPUT_BUCKETS> output_weights;
std::array<int16_t, OUTPUT_BUCKETS> output_bias;