summaryrefslogtreecommitdiff
path: root/experiments/contrastive_bias_c1_smoke.py
diff options
context:
space:
mode:
Diffstat (limited to 'experiments/contrastive_bias_c1_smoke.py')
-rw-r--r--experiments/contrastive_bias_c1_smoke.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/experiments/contrastive_bias_c1_smoke.py b/experiments/contrastive_bias_c1_smoke.py
new file mode 100644
index 0000000..eb66934
--- /dev/null
+++ b/experiments/contrastive_bias_c1_smoke.py
@@ -0,0 +1,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()