~bonbon/gmcts

1e8a72416105e3eddf23a7f8696efbe577f14481 — bonbon 1 year, 3 months ago bc629d4
separate math.Log and math.Sqrt calls
1 files changed, 2 insertions(+), 3 deletions(-)

M search.go
M search.go => search.go +2 -3
@@ 25,9 25,8 @@ func initializeNode(g gameState, tree *Tree) *node {
func (n *node) UCT2(i int, p Player) float64 {
	exploit := n.children[i].nodeScore[p] / float64(n.children[i].nodeVisits)

	explore := math.Sqrt(
		math.Log(float64(n.nodeVisits)) / n.childVisits[i],
	)
	explore := math.Log(float64(n.nodeVisits)) / n.childVisits[i]
	explore = math.Sqrt(explore)

	return exploit + n.tree.explorationConst*explore
}