-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZeroDivisionError: float division by zero #288
Comments
#191 might help |
Yes, thanks for pointing this out. However I already dicovered this one and I couldn't find anything similiar in my code. I made sure that I always copy the pieces in the game code. It just seems that mcts is not exploring edges which the players in the arena then want to play. But I guess it should only play discovered moves (s/a) in the arena since it uses greedy search, right? |
Could you share your code? |
I gladly do: https://github.com/visuallization/alpha-zero-general-hex/tree/master/hex |
I am not working with pass though, like Othello does because there is no pass in Hex. |
Okay there might be an issue how I represent the def getCanonicalForm(self, positions, player):
board = HexBoard(self.size)
board.positions = np.copy(positions)
return board.positions
#return player * board.positions |
@visuallization did you ever figure this out? I believe from looking at your fork that this issue was resolved, and is a dupe of #191 |
Hey there,
First of all thank you for sharing this repo with the public. Really cool project!
Rearding the opened issue: I experience currently a problem with MCTS in
def getActionProb
, namely the errorZeroDivisionError: float division by zero
. It originates fromprobs = [x / counts_sum for x in counts]
and the problem is that all the elements incounts
are 0 because the state/action pair has not been discovered and saved in self.Nsa yet (counts = [self.Nsa[(s, a)] if (s, a) in self.Nsa else 0 for a in range(self.game.getActionSize())]
).Any ideas what might be causing the issue & how to fix it? I see in the other projects (e.g Othello) no such problems, so I am wondering what might be culprit here. I am currently trying to make the game of hex work in the project.
Cheers
The text was updated successfully, but these errors were encountered: