1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00

UCI option EvalFile

Replace EvalDir with EvalFile
Can now browse filesystem for net (eval\nn.bin is default)
nn.bin no longer hard-coded
This commit is contained in:
FireFather 2020-07-07 23:25:20 +02:00
parent d61378cacb
commit c59583bbf0
3 changed files with 9 additions and 9 deletions

View file

@ -23,7 +23,7 @@ AlignedPtr<FeatureTransformer> feature_transformer;
AlignedPtr<Network> network;
// Evaluation function file name
const char* const kFileName = "nn.bin";
const char* kFileName = "eval\\nn.bin";
// Get a string that represents the structure of the evaluation function
std::string GetArchitectureString() {
@ -243,8 +243,8 @@ void load_eval() {
return;
}
const std::string dir_name = Options["EvalDir"];
const std::string file_name = Path::Combine(dir_name, NNUE::kFileName);
const std::string file_name = Options["EvalFile"];
NNUE::kFileName = file_name.c_str();
std::ifstream stream(file_name, std::ios::binary);
const bool result = NNUE::ReadParameters(stream);

View file

@ -36,7 +36,7 @@ extern AlignedPtr<FeatureTransformer> feature_transformer;
extern AlignedPtr<Network> network;
// Evaluation function file name
extern const char* const kFileName;
extern const char* kFileName;
// Get a string that represents the structure of the evaluation function
std::string GetArchitectureString();

View file

@ -42,7 +42,7 @@ void on_hash_size(const Option& o) { TT.resize(size_t(o)); }
void on_logger(const Option& o) { start_logger(o); }
void on_threads(const Option& o) { Threads.set(size_t(o)); }
void on_tb_path(const Option& o) { Tablebases::init(o); }
void on_eval_dir(const Option& o) { load_eval_finished = false; init_nnue(); }
void on_eval_file(const Option& o) { load_eval_finished = false; init_nnue(); }
/// Our case insensitive less() function as required by UCI protocol
@ -80,12 +80,12 @@ void init(OptionsMap& o) {
o["SyzygyProbeDepth"] << Option(1, 1, 100);
o["Syzygy50MoveRule"] << Option(true);
o["SyzygyProbeLimit"] << Option(7, 0, 7);
// Evaluation function folder. When this is changed, it is necessary to reread the evaluation function at the next isready timing.
o["EvalDir"] << Option("eval", on_eval_dir);
// When the evaluation function is loaded at the isready timing, it is necessary to convert the new evaluation function.
// Evaluation function file name. When this is changed, it is necessary to reread the evaluation function at the next ucinewgame timing.
o["EvalFile"] << Option("eval\\nn.bin", on_eval_file);
// When the evaluation function is loaded at the ucinewgame timing, it is necessary to convert the new evaluation function.
// I want to hit the test eval convert command, but there is no new evaluation function
// It ends abnormally before executing this command.
// Therefore, with this hidden option, you can suppress the loading of the evaluation function when isready,
// Therefore, with this hidden option, you can suppress the loading of the evaluation function when ucinewgame,
// Hit the test eval convert command.
o["SkipLoadingEval"] << Option(false);
// how many moves to use a fixed move