blob: eb6693445e400676d0ed0fe9b1946403b61fa90a (
plain)
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
30
31
32
33
34
35
36
37
|
#!/usr/bin/env python3
"""Static checks for the frozen same-path C1 registry."""
import json
from pathlib import Path
import sys
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "experiments"))
from contrastive_bias_c1 import CONDITIONS, SEEDS, jobs, registry_sha256
def main():
rows = jobs("/frozen/author/python")
assert len(rows) == 20
assert {row["seed"] for row in rows} == set(SEEDS)
assert {row["condition"] for row in rows} == {row[0] for row in CONDITIONS}
for seed in SEEDS:
seed_rows = [row for row in rows if row["seed"] == seed]
assert [row["condition"] for row in seed_rows] == [
row[0] for row in CONDITIONS]
for row in rows:
command = row["command"]
assert command[command.index("--seeds") + 1] == str(row["seed"])
assert command[command.index("--num-epochs") + 1] == "130"
assert command[command.index("--test-policy") + 1] == "none"
assert command[command.index("--dp-bias-ratio") + 1] == "4.0"
assert command[command.index("--dp-bias-kind") + 1] == row["kind"]
assert command[command.index("--dp-bias-rule") + 1] == row["rule"]
print(json.dumps({
"status": "passed", "num_cells": len(rows), "seeds": list(SEEDS),
"registry_sha256": registry_sha256(rows),
}, indent=2, sort_keys=True))
if __name__ == "__main__":
main()
|