Awesome Open Source
Awesome Open Source

supported platforms supported python versions dependencies status style black license MIT discord badge

MuZero General

A commented and documented implementation of MuZero based on the Google DeepMind paper (Nov 2019) and the associated pseudocode. It is designed to be easily adaptable for every games or reinforcement learning environments (like gym). You only need to add a game file with the hyperparameters and the game class. Please refer to the documentation and the example.

MuZero is a state of the art RL algorithm for board games (Chess, Go, ...) and Atari games. It is the successor to AlphaZero but without any knowledge of the environment underlying dynamics. MuZero learns a model of the environment and uses an internal representation that contains only the useful information for predicting the reward, value, policy and transitions. MuZero is also close to Value prediction networks. See How it works.


  • [x] Residual Network and Fully connected network in PyTorch
  • [x] Multi-Threaded/Asynchronous/Cluster with Ray
  • [X] Multi GPU support for the training and the selfplay
  • [x] TensorBoard real-time monitoring
  • [x] Model weights automatically saved at checkpoints
  • [x] Single and two player mode
  • [x] Commented and documented
  • [x] Easily adaptable for new games
  • [x] Examples of board games, Gym and Atari games (See list of implemented games)
  • [x] Pretrained weights available
  • [ ] Windows support (Experimental / Workaround: Use the notebook in Google Colab)

Further improvements

These improvements are active research, they are personal ideas and go beyond MuZero paper. We are open to contributions and other ideas.


All performances are tracked and displayed in real time in TensorBoard :

cartpole training summary

Testing Lunar Lander :

lunarlander training preview

Games already implemented

  • Cartpole (Tested with the fully connected network)
  • Lunar Lander (Tested in deterministic mode with the fully connected network)
  • Gridworld (Tested with the fully connected network)
  • Tic-tac-toe (Tested with the fully connected network and the residual network)
  • Connect4 (Slightly tested with the residual network)
  • Gomoku
  • Twenty-One / Blackjack (Tested with the residual network)
  • Atari Breakout

Tests are done on Ubuntu with 16 GB RAM / Intel i7 / GTX 1050Ti Max-Q. We make sure to obtain a progression and a level which ensures that it has learned. But we do not systematically reach a human level. For certain environments, we notice a regression after a certain time. The proposed configurations are certainly not optimal and we do not focus for now on the optimization of hyperparameters. Any help is welcome.

Code structure

code structure

Network summary:

Getting started


git clone
cd muzero-general

pip install -r requirements.txt



To visualize the training results, run in a new terminal:

tensorboard --logdir ./results


You can adapt the configurations of each game by editing the MuZeroConfig class of the respective file in the games folder.


Please use this bibtex if you want to cite this repository (master branch) in your publications:

  author       = {Werner Duvaud, Aurèle Hainaut},
  title        = {MuZero General: Open Reimplementation of MuZero},
  year         = {2019},
  publisher    = {GitHub},
  journal      = {GitHub repository},
  howpublished = {\url{}},

Getting involved

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (1,141,905
Python3 (33,326
Machine Learning (31,708
Deep Learning (23,700
Pytorch (11,603
Neural Network (8,618
Reinforcement Learning (3,953
Deep Reinforcement Learning (1,060
Gym (348
Rl (241
Tensorboard (239
Self Learning (128
Monte Carlo Tree Search (127
Mcts (122
Alphazero (92
Residual Networks (87
Alphago (55
Model Based Rl (33
Muzero (9
Related Projects