Buckets:
| """Random reading sample for the rl60 error analysis (fixed seed): 30 items from each of the readout x thinking cells | |
| WR (thinking fixes), RW (thinking breaks), WW (both wrong), plus 12 V2-wrong -> rl60-right and 12 V2-right -> rl60-wrong | |
| thinking flips not already drawn. Writes "<id> <bucket>" lines. | |
| python analysis/examples_sample.py --items ITEMS.jsonl --out sample_ids.txt | |
| """ | |
| from __future__ import annotations | |
| import argparse | |
| import json | |
| import random | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--items", required=True) | |
| ap.add_argument("--out", required=True) | |
| ap.add_argument("--seed", type=int, default=0) | |
| ap.add_argument("--per_cell", type=int, default=30) | |
| ap.add_argument("--per_flip", type=int, default=12) | |
| a = ap.parse_args() | |
| rows = [json.loads(l) for l in open(a.items)] | |
| rng = random.Random(a.seed) | |
| cell = lambda r: ("R" if r["ro_ok"] else "W") + ("R" if r["rl60"]["ok"] else "W") | |
| picked, out = set(), [] | |
| for c in ("WR", "RW", "WW"): | |
| pool = sorted(r["id"] for r in rows if cell(r) == c) | |
| for i in rng.sample(pool, min(a.per_cell, len(pool))): | |
| picked.add(i) | |
| out.append((i, c)) | |
| for name, test in (("V2W_RLR", lambda r: not r["v2"]["ok"] and r["rl60"]["ok"]), | |
| ("V2R_RLW", lambda r: r["v2"]["ok"] and not r["rl60"]["ok"])): | |
| pool = sorted(r["id"] for r in rows if test(r) and r["id"] not in picked) | |
| for i in rng.sample(pool, min(a.per_flip, len(pool))): | |
| picked.add(i) | |
| out.append((i, name)) | |
| with open(a.out, "w") as f: | |
| for i, c in out: | |
| f.write(f"{i} {c}\n") | |
| print(len(out), "ids") | |
| if __name__ == "__main__": | |
| main() | |
Xet Storage Details
- Size:
- 1.73 kB
- Xet hash:
- ebe08c2f5a008e3d2c1d5db833b407e71e13899cbe90916bc666979d9d9354f5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.