File size: 1,327 Bytes
430d13c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Score AW-1 by its pre-registered rule (P1: >= 12 of 24 mixed groups; P2: 0.2 <= mean <= 0.8)."""

import collections
import json
import sys

rows = [json.loads(line) for line in open(sys.argv[1])]
ok = [r for r in rows if r.get("reward") is not None]
by = collections.defaultdict(list)
for r in ok:
    by[r["task_id"]].append(r)
mixed = 0
for task, rs in by.items():
    rewards = [r["reward"] for r in rs]
    is_mixed = len(set(rewards)) > 1
    mixed += is_mixed
    ends = dict(collections.Counter(r["end"] for r in rs))
    acts = sum(r["actions"] for r in rs) / len(rs)
    print(f"{task:24s} {[round(x, 2) for x in rewards]} mean={sum(rewards) / len(rewards):.2f} "
          f"{'MIXED' if is_mixed else '     '} acts={acts:.1f} {ends}")
mean = sum(r["reward"] for r in ok) / len(ok)
turns = sum(r["actions"] for r in ok)
print(f"episodes {len(rows)}, infrastructure errors {len(rows) - len(ok)}")
print(f"P1 mixed groups {mixed} of {len(by)} -> {'confirmed' if mixed >= 12 else 'refuted'}")
print(f"P2 mean reward {mean:.3f} -> {'confirmed' if 0.2 <= mean <= 0.8 else 'refuted'}")
print("ends", dict(collections.Counter(r["end"] for r in ok)))
print(f"fenced replies {sum(r.get('fenced', 0) for r in ok)} of {turns}; mean actions {turns / len(ok):.2f}")
print(f"wall seconds {sum(r['seconds'] for r in rows):.0f}")