This project implements multi-agent reinforcement learning (MARL) algorithms to solve environments in the PettingZoo multi-agent benchmark suite. The focus is on algorithms
- Qatten
- VDN
- DQN
The repository provides training scripts, environment configurations, and tools for analyzing results using.
   ---To install all required packages and dependencies with Conda:
- Clone this repository:
git clone https://github.com/jkwiatk1/multi-agent-RL cd multi-agent-RL
- Create a Conda environment:
conda env create -f environment.yaml
- Activate the environment:
conda activate pytorch_env
Follow these steps to manually install the required dependencies:
- Initialize Conda and check existing environments:
conda init conda env list
- Create a new Conda environment named
pytorch_env
and activate it:conda create --name pytorch_env python=3.9 -y conda activate pytorch_env
- Install the required packages:
conda install -c conda-forge pettingzoo stable-baselines3 matplotlib numpy conda install -c conda-forge pettingzoo[mpe] conda install -c conda-forge tensorboard pip install supersuit set PYGAME_DETECT_AVX2=1 && conda install pygame
To ensure the environment is working:
- Run the
test.py
script
- To run experiments open src.training.experiments.py script.
- Configure params dictionaries
- Run script
- Results of training will be store under specific path.
- To evalute the trained model open src.evalution folder
- Open one of the script:
- for DQN models:
evaluate_dqn.py
- for VDN models:
evaluate_vdn.py
- for Qatten model:
evaluate_qatten.py
- for DQN models:
- Configure path where the results of trained model (train weights are stored there)
- Run script
- Results will be stored there.
To visualize experiment results using TensorBoard. Run example:
-
multi-agent-RL\src\results>tensorboard --logdir=vdn_mpe_model\0.9_gamma\25000_epochs\0.0001_lr\0.9996_eps\tensorboard_logs
Open TensorBoard in your browser by navigating to:
http://localhost:6006/
- DOCUMENTATION: https://pettingzoo.farama.org/environments/mpe/simple_spread/
- EXAMPLE_1: https://cocalc.com/share/public_paths/38a4d0aaa976e34b0c5e6df80cec05c9b6cb29d2
- EXAMPLE_2: https://towardsdatascience.com/multi-agent-deep-reinforcement-learning-in-15-lines-of-code-using-pettingzoo-e0b963c0820b
- DOCUMENTATION_example_1: https://openrl-docs.readthedocs.io/en/stable/quick_start/multi_agent_RL.html#track-training-process-with-wandb
- DOCUMENTATION_example_2: https://xuance.readthedocs.io/en/latest/documents/api/environments/multi_agent_env/mpe.html
- PAPER: https://arxiv.org/pdf/2009.14471
- OFFICIAL: https://github.com/Farama-Foundation/PettingZoo/tree/master
- OPENAI MARL: https://github.com/openai/multiagent-particle-envs
- VIDEO: https://www.youtube.com/watch?v=IMpf_X1IN_0
Examples:
- MARL libs described: https://marllib.readthedocs.io/en/latest/resources/benchmarks.html#id4
- MARL libs:
- DQN:
- https://github.com/mohammadasghari/dqn-multi-agent-rl/tree/master
- https://www.youtube.com/watch?v=EUrWGTCGzlA
- https://stable-baselines3.readthedocs.io/en/master/modules/dqn.html
- https://pytorch.org/tutorials/intermediate/reinforcement_q_learning.htm
- https://github.com/johnnycode8/gym_solutions/blob/main/frozen_lake_dql.py
- VDN:
- Qatten: