Upload code/probes/pair_cmp.py with huggingface_hub
Browse files- code/probes/pair_cmp.py +26 -0
code/probes/pair_cmp.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json, glob
|
| 2 |
+
ref = json.load(open(glob.glob("/root/ref_eval_smolvla_spatial/**/eval_info.json", recursive=True)[0]))
|
| 3 |
+
ref_succ = {}
|
| 4 |
+
for t in ref["per_task"]:
|
| 5 |
+
for i, s in enumerate(t["metrics"]["successes"]):
|
| 6 |
+
ref_succ[(t["task_id"], i)] = bool(s)
|
| 7 |
+
|
| 8 |
+
ours = [json.loads(l) for l in open("/root/SLAVA_dev/rollouts/dumps/smolvla_en/all.jsonl")]
|
| 9 |
+
ours = [r for r in ours if r["suite"] == "libero_spatial"]
|
| 10 |
+
|
| 11 |
+
both = [(r, ref_succ[(r["task_id"], r["init_state_id"])])
|
| 12 |
+
for r in ours if (r["task_id"], r["init_state_id"]) in ref_succ]
|
| 13 |
+
print(f"наших эпизодов libero_spatial: {len(ours)}")
|
| 14 |
+
print(f"наши init_state_id: {sorted({r['init_state_id'] for r in ours})}")
|
| 15 |
+
print(f"пересечение с эталоном (init 0-9): {len(both)} эпизодов")
|
| 16 |
+
if both:
|
| 17 |
+
a = sum(1 for r, _ in both if r["success"])
|
| 18 |
+
b = sum(1 for _, s in both if s)
|
| 19 |
+
agree = sum(1 for r, s in both if bool(r["success"]) == s)
|
| 20 |
+
print(f"на ОДНИХ И ТЕХ ЖЕ сценах: наш {a}/{len(both)} = {100*a/len(both):.1f}%, "
|
| 21 |
+
f"эталон {b}/{len(both)} = {100*b/len(both):.1f}%")
|
| 22 |
+
print(f"совпало поэпизодно: {agree}/{len(both)} = {100*agree/len(both):.1f}%")
|
| 23 |
+
outside = [r for r in ours if (r["task_id"], r["init_state_id"]) not in ref_succ]
|
| 24 |
+
if outside:
|
| 25 |
+
c = sum(1 for r in outside if r["success"])
|
| 26 |
+
print(f"наши сцены ВНЕ эталона (init>9): {c}/{len(outside)} = {100*c/len(outside):.1f}%")
|