summaryrefslogtreecommitdiff
path: root/experiments/oral_a_v4_calibration_screen.py
diff options
context:
space:
mode:
authorYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 13:25:15 -0500
committerYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 13:25:15 -0500
commitd4a521072a25d8afdd62021f43538d7dad7586fd (patch)
treec6d2dc1b6bdb9c857970067473e5df45906dbdec /experiments/oral_a_v4_calibration_screen.py
parentc24a6a575bce15e7d7da541ecb752c65b5e68e47 (diff)
protocol: freeze hierarchical causal-capture funnel
Diffstat (limited to 'experiments/oral_a_v4_calibration_screen.py')
-rw-r--r--experiments/oral_a_v4_calibration_screen.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/experiments/oral_a_v4_calibration_screen.py b/experiments/oral_a_v4_calibration_screen.py
new file mode 100644
index 0000000..2e29bb6
--- /dev/null
+++ b/experiments/oral_a_v4_calibration_screen.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python3
+"""Run a shard of the frozen hierarchical-feedback causal-capture screen."""
+import argparse
+import os
+import subprocess
+import sys
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--device", default="cuda")
+ parser.add_argument("--shard_index", type=int, default=0)
+ parser.add_argument("--num_shards", type=int, default=1)
+ parser.add_argument("--dry_run", action="store_true")
+ args = parser.parse_args()
+ if not 0 <= args.shard_index < args.num_shards:
+ raise ValueError("invalid shard index")
+ common = [
+ sys.executable, "experiments/conv_run.py", "--device", args.device,
+ "--depth", "20", "--width", "16", "--seed", "0",
+ "--loader_seed", "0", "--batch_size", "128", "--epochs", "0",
+ "--train_limit", "10000", "--val_examples", "5000",
+ "--split_seed", "2027", "--eval_split", "validation",
+ "--eval_every", "0", "--augment_train", "1", "--lr", "0.1",
+ "--output_lr", "0.1", "--lr_schedule", "constant",
+ "--warmup_epochs", "0", "--momentum", "0.9",
+ "--weight_decay", "1e-4", "--normalization", "batchnorm",
+ "--a_scale", "1", "--pert_sigma", "0.01",
+ "--pert_directions", "1", "--pert_every", "4",
+ "--perturb_seed", "1000", "--alignment_probe", "64",
+ ]
+ jobs = [("fixed_hfa", common + [
+ "--mode", "hfa", "--out",
+ "results/oral_a_v4_calibration/fixed_hfa.json",
+ ])]
+ for rate in (0.1, 1.0, 10.0):
+ tag = f"learned_hfa_etaA{rate}"
+ jobs.append((tag, common + [
+ "--mode", "lhfa", "--eta_A", str(rate),
+ "--a_warmup_steps", "400", "--out",
+ f"results/oral_a_v4_calibration/{tag}.json",
+ ]))
+ os.makedirs("results/oral_a_v4_calibration", exist_ok=True)
+ for index, (tag, command) in enumerate(jobs):
+ if index % args.num_shards != args.shard_index:
+ continue
+ print(tag, " ".join(command), flush=True)
+ if not args.dry_run:
+ subprocess.run(command, check=True)
+
+
+if __name__ == "__main__":
+ main()
+