MADDPG in PyTorch
A PyTorch reference implementation of Multi-Agent Deep Deterministic Policy Gradients (MADDPG).
- Stars
- ★ 378
- Last updated
- 5y ago
- FARS reviewed
- Nov 08, 2026
- Primary language
- Python
- FA score
- 35/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changes
- Cost
- Free, no paid service needed
- Setup effort
- High · needs real infrastructure
- You'll need
- Typical use
- Researchers reproducing a MADDPG baseline for comparison against their own experiments.
- Not a fit if
- Teams that want a turnkey setup without assembling the MAPE environment
- Projects pinned to the latest PyTorch, as the code notes an in-place operation issue in 1.8
- Teams looking for a production-grade multi-agent training platform
- Maintenance
- No commits for 6+ monthslast commit 2021-04-08
- Source review
- 35/100 · Major gaps
What does this agent do, and when should you use it?
This repository is a PyTorch implementation of the MADDPG algorithm from the paper 'Multi Agent Actor Critic for Mixed Cooperative-Competitive Environments'. It is not a packaged product but training code that must be paired with OpenAI's Multi Agent Particle Environment (MAPE): the main file imports the make_env function from that package, so the README suggests cloning this repo into the same directory as MAPE. The README asks for a virtual environment holding MAPE's somewhat outdated dependencies and recommends PyTorch 1.4.0, noting that 1.8 appears to break an in-place operation used in the critic loss. A companion video tutorial is linked. It best serves people reading or modifying a MADDPG implementation for study and research rather than teams needing a deployable system.
The code implements MADDPG's centralized-training, decentralized-execution scheme: each agent has actor and critic networks, and the critic consumes observations and actions from all agents when computing its loss. It instantiates a multi-agent particle environment through make_env imported from MAPE, interacts with it to collect experience, computes the critic loss, and updates the policy networks. The output is trained policy networks and their behavior in cooperative or competitive multi-agent scenarios; users drive this by running or editing the main training script. There is no packaged install, CLI, or hosted service.
- Researchers reproducing a MADDPG baseline for comparison against their own experiments.
- Students following the linked video tutorial to learn how multi-agent actor-critic is written in PyTorch.
- Developers setting up quick cooperative or competitive multi-agent experiments on MAPE particle environments.
- Researchers modifying the critic input structure to try algorithm variants.
- Instructors who want a readable MADDPG code sample for course material.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
pip install torch==1.4.0
How do you install or deploy this agent?
The README gives no pip install or packaging step; it describes manual environment setup: install MAPE in a virtual environment with its older dependencies, then clone this repo alongside MAPE because the main file imports make_env from it.
git clone https://github.com/openai/multiagent-particle-envs
python -m venv mape-env
source mape-env/bin/activate
# Install MAPE dependencies (they are outdated; follow the MAPE repo instructions)
pip install torch==1.4.0How do you use this agent?
After cloning this repository next to MAPE, activate the virtual environment prepared for MAPE and run the main training script, which builds the particle environment via make_env and starts MADDPG training.
git clone https://github.com/philtabor/Multi-Agent-Deep-Deterministic-Policy-Gradients
source mape-env/bin/activate
python <main_training_file>.pyThe README does not name the main file or its tunable parameters; check the repository source for those.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- Maps directly to the MADDPG paper, making it a readable implementation of centralized training and decentralized execution.
- Built on PyTorch, so researchers familiar with the framework can modify networks and losses easily.
- The README names a concrete version constraint (PyTorch 1.8 in-place operation issue), saving debugging time.
- Links a companion video tutorial for guided learning.
- Depends on the external MAPE repo and requires placing both repositories in the same directory, making setup fiddly.
- The recommended PyTorch 1.4.0 is significantly outdated, so newer environments may need version rollback or code fixes.
- No pip package, CLI, or tests are provided; the main training file and parameters must be read from source.
- The license is unspecified, so authorization should be confirmed before commercial or redistributed use.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| MADDPG in PyTorch This agent | 35 · Major gaps | Library / SDKFree | ★ 378 | 5y ago | Python | — |
| AgileRL | 62 · Some gaps | Library / SDKFreemium | ★ 974 | 2d ago | Python | — |
| Mava | 53 · Major gaps | CLIFree | ★ 940 | 2mo ago | Python | — |
| MARO Resource Optimization Platform | 48 · Major gaps | Library / SDKFree | ★ 924 | 3y ago | Python | — |
How does FollowAgents rate this agent?
Why each dimension lost points
The code shown is a local training loop with replay memory and model checkpoints; it shows no network transfer or credential handling, supporting a limited least-privilege score (least_privilege=2). Training, rendering, and checkpoint behavior are fixed in the script, with no user confirmation or data-flow explanation. Actions include random noise and the README flags an older environment dependency, but the files do not explain sensitive-data handling, dependency security review, or recovery from side effects. The README attributes the work to a paper and points to the environment project; publisher identity remains unknown.
The README explicitly identifies an older MAPE dependency and recommends PyTorch 1.4.0 because it reports an in-place operation issue in critic loss with a newer version. This provides partial consistency and dependency guidance. The supplied code has no error handling or user-facing failure messages, and dependency versions are not pinned, so scores remain thin.
The README and main.py identify MADDPG and the simple_adversary scenario, and expose some network parameters, but training duration, scenario, and evaluation toggle are mostly hard-coded. Environment use depends on make_env from MAPE in a neighboring directory, and the README anticipates friction from older dependencies; boundaries and broader scenario coverage are not well documented.
File roles are discernible: the entry script runs training and agent.py defines an agent. The sample is limited, with no FAQ, complete installation instructions, or consolidated limitations list. The README does document a PyTorch version issue, which is useful limitation guidance. License metadata is unknown and no changelog is shown; maintenance responsibility is only weakly indicated by the personal-implementation wording, with no update path.
The implementation connects MADDPG training, action selection, and checkpoint saving, making it a useful research or teaching starting point. Its visible outputs are training-score prints and model files, with little guidance for evaluation or using results. Older environment requirements and version advice add adoption cost, keeping the score modest.
The README links the implementation to a specific paper and identifies the external environment dependency and PyTorch issue; main.py and agent.py provide some source details to inspect. However, the packet contains only a small source sample, with no test or result evidence or corroboration across multiple sources. The compatibility statement cannot be independently confirmed in this static review.
- Check MAPE and PyTorch compatibility before installation; the README reports a possible critic-loss in-place operation issue on newer PyTorch.
- main.py defaults to a long training run of 50,000 episodes with learning every 100 steps; changing resource use or scenarios requires code edits.
- Scores use only the supplied README.md, main.py, and agent.py sample. No code was executed, and other files remain unknown.
FAQ
Can I run it with the latest PyTorch?
Is MAPE required?
Is this a deployable multi-agent system?
What license applies?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.