Skip to content

Tensor representation of chess-board for AlphaZero #987

Answered by lanctot
coulibaly-mouhamed asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, all the tensor representations of state are obtained via State::ObservationTensor or State::InformationStateTensor. In the of chess, the code is here: https://github.com/deepmind/open_spiel/blob/e75bdf114de32c2211edf36443703a6e8846a3cb/open_spiel/games/chess.cc#L315.

In python, you would get this via state.observation_tensor().

Roughly, it's a representation that is friendly to convolutional neural nets: planar inputs where each plan represents a piece type and side, and some binary planes for castling rights. I recommend you start with this. To get a stacked version of this as used in original AZ (i.e. one that takes into account the past 4-8 moves in the history), you'd have to modi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lanctot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants