Skip to content

Commit

Permalink
Clear policy for terminal loss. (LeelaChessZero#1285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilps authored and AlexisOlson committed May 10, 2020
1 parent d18ba0f commit 9563aba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mcts/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ void Node::MakeTerminal(GameResult result, float plies_left, Terminal type) {
} else if (result == GameResult::BLACK_WON) {
wl_ = -1.0f;
d_ = 0.0f;
// Terminal losses have no uncertainty and no reason for their U value to be
// comparable to another non-loss choice. Force this by clearing the policy.
if (GetParent() != nullptr) GetOwnEdge()->SetP(0.0f);
}
}

Expand Down

0 comments on commit 9563aba

Please sign in to comment.