Nnue test #48

Merged
rektdie merged 14 commits from nnue_test into main 2025-04-09 03:23:41 +02:00
3 changed files with 12 additions and 0 deletions
Showing only changes of commit d72a0c341e - Show all commits

No files matched your search

+2
View File
@@ -156,6 +156,8 @@ void Board::PrintNNUE() {
} }
std::cout << std::endl; std::cout << std::endl;
std::cout << "Final eval: " << NNUE::net.Evaluate(*this) << std::endl;
} }
void Board::AddMove(Move move) { void Board::AddMove(Move move) {
+6
View File
@@ -1,10 +1,12 @@
#include <immintrin.h> #include <immintrin.h>
#include <fstream> #include <fstream>
#include <algorithm>
#include "nnue.h" #include "nnue.h"
#include "accumulator.h" #include "accumulator.h"
#include "board.h" #include "board.h"
#include "types.h" #include "types.h"
#include "search.h"
namespace NNUE { namespace NNUE {
@@ -73,4 +75,8 @@ static int32_t Forward(const Board& board,
return (eval * SCALE) / (QA * QB); return (eval * SCALE) / (QA * QB);
} }
int16_t Network::Evaluate(const Board& board) {
return Forward(board, this);
}
} }
+4
View File
@@ -3,6 +3,8 @@
#include <string> #include <string>
#include <array> #include <array>
class Board;
namespace NNUE { namespace NNUE {
constexpr int INPUT_SIZE = 768; constexpr int INPUT_SIZE = 768;
@@ -19,6 +21,8 @@ struct Network {
int16_t output_bias; int16_t output_bias;
void Load(const std::string& path); void Load(const std::string& path);
int16_t Evaluate(const Board& board);
}; };
inline Network net; inline Network net;