Skip to content

Tutorial : How to add a game to MuZero

Werner Duvaud edited this page Mar 29, 2020 · 8 revisions

You just need to create a your-game-name.py file in the folder "games" with the configuration and the game class. You should start from an example like cartpole.

The MuZeroConfig class holds the parameters about the game, the self-play and the training. The Game class is a wrapper through which the algorithm interacts with the desired game. It follows the gym API.

We have added explanations about the parameters directly in the example files.

In the code, all actions are represented by a number. It's the action_space parameter. The legal actions are returned by the game as a list with the numbers of the actions authorized for each move.

It is recommanded to adapt num_actors, self_play_delay, training_delay to match the power of your computer.