From 1c84da9caa08a142655bedf6def85e62e4736801 Mon Sep 17 00:00:00 2001 From: nodchip Date: Sun, 13 Sep 2020 16:32:01 +0900 Subject: [PATCH 1/2] Fixed a bug that an assertion fails in the trainer. if the SkipLoading is false. Fixes #128 --- src/learn/learn.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/learn/learn.cpp b/src/learn/learn.cpp index 0459dd90..46c6a9dc 100644 --- a/src/learn/learn.cpp +++ b/src/learn/learn.cpp @@ -1988,7 +1988,13 @@ namespace Learner Eval::NNUE::SetBatchSize(nn_batch_size); Eval::NNUE::SetOptions(nn_options); if (newbob_decay != 1.0 && !Options["SkipLoadingEval"]) { - learn_think.best_nn_directory = std::string(Options["EvalDir"]); + // Save the current net to [EvalDir]\original. + Eval::save_eval("original"); + + // Set the folder above to best_nn_directory so that the trainer can + // resotre the network parameters from the original net file. + learn_think.best_nn_directory = + Path::Combine(Options["EvalSaveDir"], "original"); } cout << "init done." << endl; From a94a076e3925dcb47cc6a24182d35d01267642a4 Mon Sep 17 00:00:00 2001 From: nodchip Date: Sun, 13 Sep 2020 16:35:52 +0900 Subject: [PATCH 2/2] Fixed a comment. --- src/learn/learn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/learn/learn.cpp b/src/learn/learn.cpp index 46c6a9dc..eaabc524 100644 --- a/src/learn/learn.cpp +++ b/src/learn/learn.cpp @@ -1988,7 +1988,7 @@ namespace Learner Eval::NNUE::SetBatchSize(nn_batch_size); Eval::NNUE::SetOptions(nn_options); if (newbob_decay != 1.0 && !Options["SkipLoadingEval"]) { - // Save the current net to [EvalDir]\original. + // Save the current net to [EvalSaveDir]\original. Eval::save_eval("original"); // Set the folder above to best_nn_directory so that the trainer can