Giter VIP home page Giter VIP logo

muzero-general's Introduction

Code style: black

MuZero General

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

MuZero is a model based reinforcement learning algorithm, successor of AlphaZero. It learns to master games without knowing the rules. It only knows actions and then learn to play and master the game. It is at least more efficient than similar algorithms like AlphaZero, SimPLe and World Models. See How it works

Features

  • Fully connected network in PyTorch
  • Multi-Threaded with Ray
  • CPU/GPU support
  • TensorBoard real-time monitoring
  • Single and multiplayer mode
  • Commented and documented
  • Easily adaptable for new games
  • Examples of board and Gym games (See list below)
  • Pretrained weights available
  • Add human vs MuZero tracking in TensorBoard
  • Residual Network
  • Atari games
  • Appendix Reanalyse of the paper
  • Windows support (workaround by ihexx)

Demo

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

lunarlander training preview

Testing Lunar Lander :

lunarlander training preview

Games already implemented with pretrained network available

  • Cartpole
  • Lunar Lander
  • Connect4

Code structure

code structure

Getting started

Installation

cd muzero-general
pip install -r requirements.txt

Training

Edit the end of muzero.py:

muzero = Muzero("cartpole")
muzero.train()

Then run:

python muzero.py

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

tensorboard --logdir ./

Testing

Edit the end of muzero.py:

muzero = Muzero("cartpole")
muzero.load_model()
muzero.test()

Then run:

python muzero.py

Authors

  • Werner Duvaud
  • Aurèle Hainaut
  • Paul Lenoir

muzero-general's People

Contributors

werner-duvaud avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.