Skip to content
Mean Field Multi-Agent Reinforcement Learning
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples soft update Feb 21, 2019
resources add battle.gif Jul 12, 2018
.gitignore update ignore Dec 8, 2018 add requirements for Ising Aug 1, 2018 fix bug: no mean field in mfac and mfq implementation Dec 8, 2018 MF-Q for Ising Jun 7, 2018 boltzman policy Feb 21, 2019

Mean Field Multi-Agent Reinforcement Learning

A PyTorch implementation of MF-Q and MF-AC in the paper Mean Field Multi-Agent Reinforcement Learning .



An 20x20 Ising model example under the low temperature.

A 40x40 Battle Game gridworld example with 128 agents, the blue one is MFQ, and the red one is IL.

Code structure

  • contains code for running tabular based MFQ for Ising model.

  • ./examples/: contains scenarios for Ising Model and Battle Game (also models).

  • contains code for running Battle Game with trained model

  • contains code for training Battle Game models

Compile Ising environment and run


  • python==3.6.1
  • gym==0.9.2 (might work with later versions)
  • matplotlib if you would like to produce Ising model figures

Compile MAgent platform and run

Before running Battle Game environment, you need to compile it. You can get more helps from: MAgent

Steps for compiling

cd examples/battle_model

Steps for training models under Battle Game settings

  1. Add python path in your ~/.bashrc or ~/.zshrc:

    vim ~/.zshrc
    export PYTHONPATH=./examples/battle_model/python:${PYTHONPATH}
    source ~/.zshrc
  2. Run training script for training (e.g. mfac):

    python3 --algo mfac

    or get help:

    python3 --help

Paper citation

If you found it helpful, consider citing the following paper:

  title = 	 {Mean Field Multi-Agent Reinforcement Learning},
  author = 	 {Yang, Yaodong and Luo, Rui and Li, Minne and Zhou, Ming and Zhang, Weinan and Wang, Jun},
  booktitle = 	 {Proceedings of the 35th International Conference on Machine Learning},
  pages = 	 {5567--5576},
  year = 	 {2018},
  editor = 	 {Dy, Jennifer and Krause, Andreas},
  volume = 	 {80},
  series = 	 {Proceedings of Machine Learning Research},
  address = 	 {Stockholmsmässan, Stockholm Sweden},
  month = 	 {10--15 Jul},
  publisher = 	 {PMLR}
You can’t perform that action at this time.