Skip to content

Commit

Permalink
Bug fix #43
Browse files Browse the repository at this point in the history
  • Loading branch information
suragnair committed Mar 13, 2018
1 parent 31be62a commit c1be816
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MCTS.py
@@ -1,5 +1,6 @@
import math
import numpy as np
EPS = 1e-8

class MCTS():
"""
Expand Down Expand Up @@ -103,7 +104,7 @@ def search(self, canonicalBoard):
if (s,a) in self.Qsa:
u = self.Qsa[(s,a)] + self.args.cpuct*self.Ps[s][a]*math.sqrt(self.Ns[s])/(1+self.Nsa[(s,a)])
else:
u = self.args.cpuct*self.Ps[s][a]*math.sqrt(self.Ns[s]) # Q = 0 ?
u = self.args.cpuct*self.Ps[s][a]*math.sqrt(self.Ns[s] + EPS) # Q = 0 ?

if u > cur_best:
cur_best = u
Expand Down

0 comments on commit c1be816

Please sign in to comment.