File size: 3,576 Bytes
e1f5428
 
 
 
 
 
 
 
 
 
 
 
 
0ba91b5
 
e1f5428
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66c5e7e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e1f5428
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
license: mit
tags:
  - reinforcement-learning
  - multi-agent
  - maddpg
  - mlx
  - simulation
library_name: mlx
---

# Margin Play — Trained Checkpoints

**Website:** [marginplay.app](https://www.marginplay.app/) · **Code:** [github.com/aiacontext/marginplay](https://github.com/aiacontext/marginplay)

Pretrained MADDPG weights for the [Margin Play](https://github.com/aiacontext/marginplay) multi-agent reinforcement learning simulation of oil exploration in the Brazilian Equatorial Margin.

## Contents

This repository holds the **final policy weights** of the `sweep_v6_6sc_10k` training run (10,000 episodes per scenario, 6 scenarios, 6 agents).

### Scenarios (6)

| Key | Description |
|---|---|
| `referencia` | Reference baseline |
| `otimista` | Optimistic price/discovery assumptions |
| `pessimista` | Pessimistic price/discovery assumptions |
| `choque_brent` | Brent oil price shock |
| `ma_prospero` | Prosperous Maranhão variant |
| `sem_lei12858` | Without Law 12,858 (royalty redistribution removed) |

### Agents (6)

`operadora`, `anp`, `ibama`, `gov_federal`, `gov_estadual`, `comunidade`.

### Files

For each scenario × agent there is:

- `{scenario}_actor_{agent}.npz` — Actor (policy) MLP weights
- `{scenario}_critic_{agent}.npz` — Critic (Q-function) MLP weights

Plus per-scenario episode logs:

- `{scenario}_episodes.parquet` — Step-level state/action/reward log
- `sweep_summary.parquet` — Aggregated metrics across the sweep

## Usage

```bash
pip install huggingface-hub
hf download aiacontext/marginplay --local-dir models/
```

Then load with the [Margin Play](https://github.com/aiacontext/marginplay) codebase:

```python
import numpy as np
from agents.networks import Actor
from agents.definitions import SPECS, state_dim_global

weights = np.load("models/referencia_actor_operadora.npz")
actor = Actor(state_dim=state_dim_global(), action_dim=SPECS["operadora"].action_dim)
actor.load_weights(list(weights.items()))
```

With `explore=False` the policy is deterministic — same scenario seed and intervention log produce reproducible trajectories.

## Training

- Algorithm: MADDPG (Multi-Agent DDPG) with target networks and OU exploration noise
- Framework: [MLX](https://github.com/ml-explore/mlx) on Apple Silicon
- Episodes per scenario: 10,000
- See [training scripts](https://github.com/aiacontext/marginplay/tree/main/scripts) for full configuration

## Citation

If you use these weights or the Margin Play simulator in academic work, please cite:

```bibtex
@unpublished{leitaofilho2026marginplay,
  title  = {Margin Play: A Multi-Agent System for Public Policy Analysis
            in the Brazilian Equatorial Margin},
  author = {Leit{\~a}o Filho, Antonio de Sousa and
            Lima, Fabr{\'\i}cio Saul and
            Santos, Selby Mykael Lima dos and
            Sousa, Rejani Bandeira Vieira and
            Jesus, Lu{\'\i}s Jorge Mesquita de and
            Silva, Dennys Correia da and
            Barros Filho, Allan Kardec Duailibe},
  year   = {2026},
  note   = {Manuscript in preparation},
}
```

Plain text:

> Leitão Filho, A. S., Lima, F. S., Santos, S. M. L. dos, Sousa, R. B. V., Jesus, L. J. M. de, Silva, D. C. da, & Barros Filho, A. K. D. (2026). *Margin Play: A Multi-Agent System for Public Policy Analysis in the Brazilian Equatorial Margin*. Manuscript in preparation.

**Corresponding author:** Antonio de Sousa Leitão Filho — [antonio@aiacontext.com](mailto:antonio@aiacontext.com) — ORCID [0009-0002-1705-3611](https://orcid.org/0009-0002-1705-3611).

## License

MIT.