AlphaZeroIncubator / AlphaZero

Our implementation of AlphaZero for simple games such as Tic-Tac-Toe and Connect4.
0 stars 0 forks source link

Connect4 Initial Implementation #36

Closed abhon closed 4 years ago

abhon commented 4 years ago

I started the Connect4 implementation, and have finished most of the logic for the get_game_status method. There might be a better way to write out the logic for producing all the diagonals, and I will think about it some more. Just asking to hear what you guys think about make_move/board_after_move function(its still the same as tic-tac-toe) for now, but rather than taking a tuple, I'm thinking it should probably just take the column where the player wants to put their piece, and then add it to the last -1 value in the tensor? Wanted to see what you guys thought about it.

abhon commented 4 years ago

The more I think about it, I need to redo get_game_status method completely, will work on it over the weekend.

abhon commented 4 years ago

@charlesoblack black does slices with space before and after the colon, but flake8 doesnt like that. Is there anyway to avoid that? It's the: E203 whitespace before ':' error from flake8

guidopetri commented 4 years ago

@abhon black is (unfortunately) right: https://www.python.org/dev/peps/pep-0008/#pet-peeves let's just ignore for now

abhon commented 4 years ago

I finished the Connect4 Implementation/Testing, although it is a little brute force. I wasn't able to get it working with Leo's winning move function, but I kept it there if want to improve on the class later. Most likely the get_board_status will be a bottleneck, but I wanted to get something working so you guys could test self_play/mcts on it. Sorry for taking so long!

Edit: Also the flake8 error is just something that occurs because of a little conflict with black as mentioned above, the functions run as intended to.

guidopetri commented 4 years ago

Looks good to me! Thanks Alec!