Using the code
Everything runs from the repo root. Each script prints the JAX devices it uses (CPU
locally, GPU on a cluster) and writes outputs under results/.
The environments (problem setups)
| name | actions | reward |
|---|---|---|
| relay_discrete | Discrete(K) | 1 - |a - θ| (graded tracking) |
| robot_consensus | Box (continuous) | exp(-error) (formation quality) |
The solvers (baselines)
All in src/coadapt/solvers/, each an independent learner per agent:
reinforce, ppo, grpo, trpo,
recurrent (PPO with a self-contained GRU belief for partial observability).
Entry points
# train one solver on one env, save a learning curve
PYTHONPATH=src python3 scripts/run.py --env relay_discrete --solver ppo \
--N 8 --seeds 16 --horizon 60 --iters 300
# sweep network size N (static vs the "wall" condition)
PYTHONPATH=src python3 scripts/sweep_N.py --env relay_discrete --Ns 3 5 8 12 16
# 3-D collapse surface over (delay, drift) per N
PYTHONPATH=src python3 scripts/surface_delay_nu.py --env relay_discrete
# run EVERY solver and emit a Markdown comparison table
PYTHONPATH=src python3 scripts/compare.py --Ns 4 8 16 --iters 400 --seeds 32
Example wrappers
The examples/ folder has one shell script per task
(01_train_single.sh, 02_sweep_N.sh, 03_surface_delay_nu.sh,
04_compare_solvers.sh). See examples/README.md.
Arbitrary seeds & horizon
--seeds, --horizon, --iters, --N are all
call-time arguments. The rollout is scan over time and vmap over
seeds, so the same code scales on a GPU by raising these.