junxiaosong / AlphaZero_Gomoku

An implementation of the AlphaZero algorithm for Gomoku (also called Gobang or Five in a Row)
MIT License
3.23k stars 962 forks source link

Potential error #110

Open Fernadoo opened 4 years ago

Fernadoo commented 4 years ago

In game.py, line 62-72:

def current_state(self):
    ....
    square_state[0][move_curr // self.width, move_curr % self.height] = 1.0
    ....

I assume you may actually mean [move_curr // self.width, move_curr % self.width]. Not a fatal bug if you are testing with square boards.

WangChuanYuan commented 3 years ago

It should be [move_curr // self.height, move_curr % self.height]? As the shape of square_state is (4, self.width, self.height), so the third dimension should be height? By the way, why reshape to (height, width) in https://github.com/junxiaosong/AlphaZero_Gomoku/blob/a2555b26e38aaaa08270e0731c53135e6222ef46/train.py#L73, although they are the same.