Verify whether there is a network being used during training.

This commit is contained in:
Tomasz Sobczyk
2020-10-14 20:20:10 +02:00
committed by nodchip
parent e503cc4ea8
commit 5db46d0c82
7 changed files with 58 additions and 32 deletions
+1 -1
View File
@@ -1000,7 +1000,7 @@ namespace Learner
<< " detect_draw_by_insufficient_mating_material = " << detect_draw_by_insufficient_mating_material << endl;
// Show if the training data generator uses NNUE.
Eval::NNUE::verify();
Eval::NNUE::verify_eval_file_loaded();
Threads.main()->ponder = false;
+24 -22
View File
@@ -1486,6 +1486,27 @@ namespace Learner
std::cout << "..shuffle_on_memory done." << std::endl;
}
static void set_learning_search_limits()
{
// About Search::Limits
// Be careful because this member variable is global and affects other threads.
auto& limits = Search::Limits;
limits.startTime = now();
// Make the search equivalent to the "go infinite" command. (Because it is troublesome if time management is done)
limits.infinite = true;
// Since PV is an obstacle when displayed, erase it.
limits.silent = true;
// If you use this, it will be compared with the accumulated nodes of each thread. Therefore, do not use it.
limits.nodes = 0;
// depth is also processed by the one passed as an argument of Learner::search().
limits.depth = 0;
}
// Learning from the generated game record
void learn(Position&, istringstream& is)
{
@@ -1837,30 +1858,9 @@ namespace Learner
cout << "init.." << endl;
// Read evaluation function parameters
Eval::NNUE::init();
Threads.main()->ponder = false;
// About Search::Limits
// Be careful because this member variable is global and affects other threads.
{
auto& limits = Search::Limits;
limits.startTime = now();
// Make the search equivalent to the "go infinite" command. (Because it is troublesome if time management is done)
limits.infinite = true;
// Since PV is an obstacle when displayed, erase it.
limits.silent = true;
// If you use this, it will be compared with the accumulated nodes of each thread. Therefore, do not use it.
limits.nodes = 0;
// depth is also processed by the one passed as an argument of Learner::search().
limits.depth = 0;
}
set_learning_search_limits();
cout << "init_training.." << endl;
Eval::NNUE::InitializeTraining(seed);
@@ -1907,6 +1907,8 @@ namespace Learner
sr.read_validation_set(validation_set_file_name, eval_limit);
}
Eval::NNUE::verify_any_net_loaded();
// Calculate rmse once at this point (timing of 0 sfen)
// sr.calc_rmse();
-5
View File
@@ -11,11 +11,6 @@
void MultiThink::go_think()
{
// Read evaluation function, etc.
// In the case of the learn command, the value of the evaluation function may be corrected after reading the evaluation function, so
// Skip memory corruption check.
Eval::NNUE::init();
// Call the derived class's init().
init();