Datasets:
Download scripts/racenet_report.py from Nabidnur/RoboRACE-Bench: direct link, hf CLI and curl.
- Browser
- Download file 4.74 kB
-
https://huggingface.co/datasets/Nabidnur/RoboRACE-Bench/resolve/main/scripts/racenet_report.py
- Command line
-
hf download hf://datasets/Nabidnur/RoboRACE-Bench/scripts/racenet_report.py
-
curl -L -o racenet_report.py https://huggingface.co/datasets/Nabidnur/RoboRACE-Bench/resolve/main/scripts/racenet_report.py
4.74 kB
| """Markdown fragments about RACE-Net shared by the README and the Hugging Face model card (generated from results).""" | |
| import json | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def _p(x): | |
| return f"{100 * x:.1f}" | |
| def selection_md(): | |
| p = ROOT / "models/racenet/selection.json" | |
| if not p.exists(): | |
| return "" | |
| s = json.loads(p.read_text()) | |
| if "dev_mean" not in s["candidates"][0]: | |
| return "" | |
| ref = s["references_dev"] | |
| def dev_mean(m): | |
| return sum(ref[k][m]["mean"] for k in ref) / len(ref) | |
| def row(c): | |
| b = "**" if c["selected"] else "" | |
| kind = "EM-refinement" if c.get("advisors") else "plain" | |
| return (f"| {b}{c['name']}{' (released)' if c['selected'] else ''}{b} | {c['generator']} · {kind} | {c['steps']:,} | {c['params']:,} | " | |
| f"{_p(c['synthetic_v3'])} | {b}{_p(c['dev_mean'])}{b} | {_p(c['dev_pool_mean'])} | {_p(c['test']['SO-101']['mean'])} / {_p(c['test']['Panda']['mean'])} | " | |
| f"{_p(c['test_pool']['SO-101']['mean'])} / {_p(c['test_pool']['Panda']['mean'])} |") | |
| rows = "\n".join(row(c) for c in sorted(s["candidates"], key=lambda c: -c["dev_mean"])) | |
| note = "" | |
| kp = ROOT / "results/kaggle/racenet_training.json" | |
| if kp.exists(): | |
| k = json.loads(kp.read_text()) | |
| note = (f"\nCheckpoints marked Kaggle were trained in Kaggle CPU notebooks ({k['cpus']} vCPU; logs in `results/kaggle/`). " | |
| "All checkpoints are in `models/racenet/candidates/`.\n") | |
| return f"""**Checkpoints and selection.** Rule: {s['rule']}. The history splits are the benchmark's unlabelled calibration | |
| data; no label-free method ever used their labels, so they serve as development data for the two arms, and the evaluation | |
| splits stay test sets. Test columns were computed after the choice and are shown for transparency. On the same development | |
| sets RACE-S online scores {_p(dev_mean('race_s_online (new)'))} and RACE online {_p(dev_mean('race_online (new)'))}. | |
| | checkpoint | generator · type | steps | params | synthetic (v3) | dev: RACE-Net-V (selects) | dev: RACE-Pool | test SO-101 / Panda: RACE-Net-V | test: RACE-Pool | | |
| |---|---|---:|---:|---:|---:|---:|---:|---:| | |
| {rows} | |
| {note}""" | |
| def scaling_md(img="media/figures/racenet_scaling.png"): | |
| p = ROOT / "results/racenet/analysis.json" | |
| if not p.exists(): | |
| return "" | |
| d = json.loads(p.read_text()) | |
| def at(key, x): | |
| return next(r for r in d[key] if r["x"] == x)["acc"] | |
| a5, a16 = at("liar_fraction_J5", 0.6), d["liar_fraction_J16"][-1]["acc"] | |
| big, w8, wk = d["swarm_size"][-1], d["window"][0]["acc"], d["receiver_skill_clean"][0]["acc"] | |
| v2 = "" | |
| if "race_net_v1" in wk: | |
| w7 = at("receiver_skill_clean", 0.7) | |
| v2 = (f"- **Against the first release.** Weak receivers: {_p(wk['race_net'])} at 55% and {_p(w7['race_net'])} at 70% receiver accuracy " | |
| f"(first release {_p(wk['race_net_v1'])} and {_p(w7['race_net_v1'])}). {big['J']}-agent swarms: {_p(big['acc']['race_net'])} (first release " | |
| f"{_p(big['acc']['race_net_v1'])}).\n") | |
| pool = "" | |
| if "race_pool" in wk: | |
| pool = (f"- **RACE-Pool** on the same sweeps: {_p(a5['race_pool'])} with 3 of 5 lying, {_p(big['acc']['race_pool'])} at {big['J']} agents, " | |
| f"{_p(wk['race_pool'])} with a 55% receiver.\n") | |
| return f"""<p align="center"><img src="{img}" width="980"></p> | |
| **Scaling study** (`scripts/racenet_analysis.py`; an independent synthetic generator, not the training distribution; {d['seeds']} seeds per point): | |
| - **Liar majority.** With 3 of 5 agents lying: RACE-Net-V {_p(a5['race_net'])}, RACE-S online {_p(a5['race_s_online'])}, RACE online {_p(a5['race_online'])}, | |
| majority {_p(a5['majority'])}. With 15 of 16 lying: {_p(a16['race_net'])} / {_p(a16['race_s_online'])} / {_p(a16['race_online'])} / {_p(a16['majority'])}. | |
| - **Short windows.** With only 8 unlabelled episodes: RACE-Net-V {_p(w8['race_net'])}, RACE-S online {_p(w8['race_s_online'])}, receiver alone {_p(w8['receiver_only'])}; | |
| no label-free method beats the receiver before about 32 episodes. | |
| - **Large swarms.** At {big['J']} agents (larger than any training swarm): RACE-Net-V {_p(big['acc']['race_net'])}, RACE online {_p(big['acc']['race_online'])}, | |
| RACE-S online {_p(big['acc']['race_s_online'])}. | |
| - **Weak receiver (open weakness).** If the receiver is only 55% accurate and nobody lies, RACE-Net-V reaches {_p(wk['race_net'])} and RACE-S online | |
| {_p(wk['race_s_online'])}, while majority reaches {_p(wk['majority'])} and discrete RACE {_p(wk['race_online'])}. Score-level anchoring trusts a weak | |
| receiver too much; from a 70% receiver upwards the gap is gone. | |
| {v2}{pool}""" | |