diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 9b3b58c3..4ba89675 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -32,6 +32,13 @@ #include "thread.h" #include "uci.h" +#ifdef EVAL_LEARN +namespace Learner +{ + extern bool use_raw_nnue_eval; +} +#endif + namespace Eval { bool useNNUE; @@ -941,6 +948,11 @@ make_v: /// evaluation of the position from the point of view of the side to move. Value Eval::evaluate(const Position& pos) { +#ifdef EVAL_LEARN + if (Learner::use_raw_nnue_eval) { + return NNUE::evaluate(pos); + } +#endif if (Eval::useNNUE) { diff --git a/src/learn/learner.cpp b/src/learn/learner.cpp index 3eb97923..029285e8 100644 --- a/src/learn/learner.cpp +++ b/src/learn/learner.cpp @@ -133,6 +133,10 @@ double dest_score_max_value = 1.0; // probabilities in the trainer. Sometimes we want to use the winning probabilities in the training // data directly. In those cases, we set false to this variable. bool convert_teacher_signal_to_winning_probability = true; +// Enable hybrid eval. If hybrid eval is enabled, training data generation and +// training don't work well. +// https://discordapp.com/channels/435943710472011776/733545871911813221/748524079761326192 +bool use_raw_nnue_eval = false; // ----------------------------------- // write phase file @@ -1050,6 +1054,8 @@ void gen_sfen(Position&, istringstream& is) is >> detect_draw_by_consecutive_low_score; else if (token == "detect_draw_by_insufficient_mating_material") is >> detect_draw_by_insufficient_mating_material; + else if (token == "use_raw_nnue_eval") + is >> use_raw_nnue_eval; else cout << "Error! : Illegal token " << token << endl; } @@ -3227,6 +3233,7 @@ void learn(Position&, istringstream& is) else if (option == "dest_score_min_value") is >> dest_score_min_value; else if (option == "dest_score_max_value") is >> dest_score_max_value; else if (option == "convert_teacher_signal_to_winning_probability") is >> convert_teacher_signal_to_winning_probability; + else if (option == "use_raw_nnue_eval") is >> use_raw_nnue_eval; // Otherwise, it's a filename. else