AlphaZeroIncubator / AlphaZero

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

Storage format #10

Closed guidopetri closed 4 years ago

guidopetri commented 4 years ago

I just decided to save as JSON for now. It also saves the board width/height. The tensor in board_state should be binary.

It also abuses some (hopeful) API for the Game class that has width, height, board_state as properties and a constructor from_json that can read the json dict and create a game of that kind with the appropriate params.

PhilipEkfeldt commented 4 years ago

Looks good. Only question, does the game object here represent a game rule set or an game instance state?

guidopetri commented 4 years ago

It should be an instance of a game, so a specific game. Otherwise there couldn't be a board state for it :P

PhilipEkfeldt commented 4 years ago

It should be an instance of a game, so a specific game. Otherwise there couldn't be a board state for it :P

Right, I was just thinking it could be a starting state. :P

guidopetri commented 4 years ago

Ah, I see what you mean. I'm mostly styling this along the lines of the python-chess library because I think it has some great things about it. Here's a link to the docs. In my mind, we should be working off of Game subclass instances, which then have things like the list of moves so far, the legal moves, the current board state, etc.

PhilipEkfeldt commented 4 years ago

Ah, I see what you mean. I'm mostly styling this along the lines of the python-chess library because I think it has some great things about it. Here's a link to the docs. In my mind, we should be working off of Game subclass instances, which then have things like the list of moves so far, the legal moves, the current board state, etc.

Ah nice, I'll check it out! See my other comment #12 for how I imagined it. I'm flexible, just want to avoid unnecessary boilerplate in the mcts implementation.