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

At a glance

How it runs
Library / SDK
Works with
Portable with changes
Cost
Free, no paid service needed
Setup effort
High · needs real infrastructure
You'll need
Python virtual environment for MAPEPyTorch 1.4.0Multi Agent Particle Environment (MAPE)make_env function from MAPEShell / CLINetwork accessLocal filesystem
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

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.

  1. Researchers reproducing a MADDPG baseline for comparison against their own experiments.
  2. Students following the linked video tutorial to learn how multi-agent actor-critic is written in PyTorch.
  3. Developers setting up quick cooperative or competitive multi-agent experiments on MAPE particle environments.
  4. Researchers modifying the critic input structure to try algorithm variants.
  5. 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.0

How 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>.py

The 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)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

What are this agent's strengths and limitations?

Pros
  • 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.
Limitations
  • 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?

FollowAgents source review · FARS-2.1
Major gaps
35/ 100 5-point scale 1.8 / 5
Trust 12/29
Reliability 3/14
Adaptability 6/18
Convention 6/18
Effectiveness 4/13
Verifiability 4/8
Why each dimension lost points
Trust12 / 29 · 2.1/5

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.

Reliability3 / 14 · 1.1/5

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.

Adaptability6 / 18 · 1.7/5

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.

Convention6 / 18 · 1.7/5

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.

Effectiveness4 / 13 · 1.5/5

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.

Verifiability4 / 8 · 2.5/5

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.

Risks and how to mitigate them
  • 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.
Evidence confidence: Low Reviewed Nov 08, 2026 Reviewed revision a3c294aa6834
Review evidence README.mdmain.pyagent.py
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/multi-agent-deep-deterministic-policy-gradients.svg)](https://followagents.com/en/agents/multi-agent-deep-deterministic-policy-gradients)
<a href="https://followagents.com/en/agents/multi-agent-deep-deterministic-policy-gradients"><img src="https://followagents.com/badge/multi-agent-deep-deterministic-policy-gradients.svg" alt="FARS review"></a>

FAQ

Can I run it with the latest PyTorch?
The README recommends PyTorch 1.4.0 and says 1.8 appears to have an issue with an in-place operation used in the critic loss; newer versions may require code changes.
Is MAPE required?
Yes. The main file relies on the make_env function from the MAPE package, and the README suggests cloning this repo into the same directory as MAPE.
Is this a deployable multi-agent system?
No. It is training code only, with no packaged install, server, or command-line interface; you run and adapt the training script yourself.
What license applies?
The license is listed as unknown, so confirm the terms with the repository before use or redistribution.
Was this page helpful?
View on GitHub ↗ Install ↓

Related concepts