added NNUE eval
This commit is contained in:
1 parent
40f28f6955
commit
d72a0c341e
3 files changed
+12
No files matched your search
@@ -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) {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in new issue
Block a user