Skip to content

Commit

Permalink
Allow configuring default komi at compile-time.
Browse files Browse the repository at this point in the history
Pull request leela-zero#2257.
  • Loading branch information
apetresc authored and AncalagonX committed Mar 19, 2019
1 parent 8c5068a commit 6fb5b6b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/GTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void GTP::execute(GameState & game, const std::string& xinput) {
} else if (command.find("komi") == 0) {
std::istringstream cmdstream(command);
std::string tmp;
float komi;
float komi = KOMI;
float old_komi = game.get_komi();

cmdstream >> tmp; // eat komi
Expand Down Expand Up @@ -635,7 +635,7 @@ void GTP::execute(GameState & game, const std::string& xinput) {
} else if (command.find("narrow_search") == 0) {
//m_search_width = (1.11 * m_search_width); // Not used. Instead, this is performed with the below command in UCTNode.cpp.
UCTNode::narrow_search();
game.set_komi((cfg_manual_komi / 10.0f));
//game.set_komi((cfg_manual_komi / 10.0f)); // Shouldn't need this anymore since I have this command spammed everywhere else already, like in "genmove" below.
return;

} else if (command.find("genmove") == 0
Expand Down
2 changes: 1 addition & 1 deletion src/Leela.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ int main(int argc, char *argv[]) {
auto maingame = std::make_unique<GameState>();

/* set board limits */
maingame->init_game(BOARD_SIZE, TRAINED_UNIT_KOMI);
maingame->init_game(BOARD_SIZE, KOMI);

if (cfg_benchmark) {
cfg_quiet = false;
Expand Down
5 changes: 2 additions & 3 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ static constexpr auto NUM_INTERSECTIONS = BOARD_SIZE * BOARD_SIZE;
static constexpr auto POTENTIAL_MOVES = NUM_INTERSECTIONS + 1; // including pass

/*
* TRAINED_UNIT_KOMI: Define the komi used during training that represents a
* value of 1.0 for the side to move NN inputs
* KOMI: Define the default komi to use when training.
*/
static constexpr auto TRAINED_UNIT_KOMI = 7.5f;
static constexpr auto KOMI = 7.5f;

/*
* Features
Expand Down

0 comments on commit 6fb5b6b

Please sign in to comment.