Download code/case2/make_chrono_jobs.py from harryzhang1018/TestRandomization: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/datasets/harryzhang1018/TestRandomization/resolve/main/code/case2/make_chrono_jobs.py
- Command line
-
hf download hf://datasets/harryzhang1018/TestRandomization/code/case2/make_chrono_jobs.py
-
curl -L -o make_chrono_jobs.py https://huggingface.co/datasets/harryzhang1018/TestRandomization/resolve/main/code/case2/make_chrono_jobs.py
834 Bytes
| """Write a Chrono job list (policy x goal) for a goal set and pool. Usage: python make_chrono_jobs.py A explore out.jsonl""" | |
| import json | |
| import sys | |
| from common import make_goal_set, policy_registry | |
| from run_rom import N_PER_RANGE, POOLS | |
| set_name, pool, out = sys.argv[1:4] | |
| reg = policy_registry() | |
| goals = make_goal_set(set_name, N_PER_RANGE[set_name]) | |
| pols = [p for p in POOLS[pool] if p in reg] | |
| if len(pols) < len(POOLS[pool]): | |
| print('not yet registered (skipped):', sorted(set(POOLS[pool]) - set(pols))) | |
| with open(out, 'w') as f: | |
| # goal-major order so that partial runs cover all policies on the first goals | |
| for g in goals: | |
| for p in pols: | |
| f.write(json.dumps(dict(policy=p, policy_path=reg[p]['path'], goal_id=g['goal_id'], x=g['x'], y=g['y'])) + '\n') | |
| print(len(goals) * len(pols), 'jobs ->', out) | |