Add a nodes bound for the multiPV search in "generate_training_data".

This commit is contained in:
Tomasz Sobczyk
2021-09-15 23:29:24 +02:00
parent f2dbb3f6c8
commit 474b63754d
2 changed files with 12 additions and 2 deletions
+2
View File
@@ -44,6 +44,8 @@ Currently the following options are available:
`random_multi_pv_depth` - the depth to use for multiPV search for random move. Default: `depth2`.
`random_multi_pv_nodes` - the maximum number of nodes for a multiPV search for random move. Default: `nodes`.
`write_min_ply` - minimum ply for which the training data entry will be emitted. Default: 16.
`write_max_ply` - maximum ply for which the training data entry will be emitted. Default: 400.
+10 -2
View File
@@ -75,6 +75,7 @@ namespace Stockfish::Tools
int random_multi_pv = 0;
int random_multi_pv_diff = 32000;
int random_multi_pv_depth = -1;
uint64_t random_multi_pv_nodes = 0;
// The minimum and maximum ply (number of steps from
// the initial phase) of the sfens to write out.
@@ -108,7 +109,11 @@ namespace Stockfish::Tools
num_threads = Options["Threads"];
random_multi_pv_depth = std::max(search_depth_max, random_multi_pv_depth);
if (random_multi_pv_depth == -1)
random_multi_pv_depth = search_depth_max;
if (random_multi_pv_nodes == 0)
random_multi_pv_nodes = nodes;
}
};
@@ -633,7 +638,7 @@ namespace Stockfish::Tools
}
else
{
Search::search(pos, params.random_multi_pv_depth, params.random_multi_pv);
Search::search(pos, params.random_multi_pv_depth, params.random_multi_pv, params.random_multi_pv_nodes);
// Select one from the top N hands of root Moves
auto& rm = pos.this_thread()->rootMoves;
@@ -828,6 +833,8 @@ namespace Stockfish::Tools
is >> params.random_multi_pv_diff;
else if (token == "random_multi_pv_depth")
is >> params.random_multi_pv_depth;
else if (token == "random_multi_pv_nodes")
is >> params.random_multi_pv_nodes;
else if (token == "write_min_ply")
is >> params.write_minply;
else if (token == "write_max_ply")
@@ -913,6 +920,7 @@ namespace Stockfish::Tools
<< " - random_multi_pv = " << params.random_multi_pv << endl
<< " - random_multi_pv_diff = " << params.random_multi_pv_diff << endl
<< " - random_multi_pv_depth = " << params.random_multi_pv_depth << endl
<< " - random_multi_pv_nodes = " << params.random_multi_pv_nodes << endl
<< " - write_min_ply = " << params.write_minply << endl
<< " - write_max_ply = " << params.write_maxply << endl
<< " - book = " << params.book << endl