summaryrefslogtreecommitdiff
path: root/experiments/oral_a_full_development.py
diff options
context:
space:
mode:
authorYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 06:25:06 -0500
committerYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 06:25:06 -0500
commit94fc8471c515fb0baacc0aa79d4a47f539858e57 (patch)
tree39236544cef50f50559669a4bbf5bebd231c1b2e /experiments/oral_a_full_development.py
parent931273085034d48db5d93b71669ba9bc30b8bc4d (diff)
experiments: freeze oral A confirmation gates
Diffstat (limited to 'experiments/oral_a_full_development.py')
-rwxr-xr-xexperiments/oral_a_full_development.py64
1 files changed, 64 insertions, 0 deletions
diff --git a/experiments/oral_a_full_development.py b/experiments/oral_a_full_development.py
new file mode 100755
index 0000000..0d8b8eb
--- /dev/null
+++ b/experiments/oral_a_full_development.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python3
+"""Run a shard of the frozen A3 full ResNet-20 local-method development gate."""
+import argparse
+import json
+import os
+import subprocess
+import sys
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--short_selection", default="results/oral_a_short_selection.json")
+ parser.add_argument("--bp_selection", default="results/oral_a_bp_selection.json")
+ 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")
+ with open(args.short_selection) as handle:
+ short = json.load(handle)
+ with open(args.bp_selection) as handle:
+ bp = json.load(handle)
+ if short["status"] != "selected":
+ raise ValueError("A2b advancement gate did not pass")
+ if not bp["status"].startswith("passed_"):
+ raise ValueError("A1 BP reference gate did not pass")
+ dfa = short["selected_dfa"]
+ sdil = short["selected_sdil"]
+ common = [
+ sys.executable, "experiments/conv_run.py", "--device", args.device,
+ "--depth", "20", "--width", "16", "--seed", "0", "--loader_seed", "0",
+ "--batch_size", "128", "--epochs", "200", "--val_examples", "5000",
+ "--split_seed", "2027", "--eval_split", "validation", "--eval_every", "20",
+ "--augment_train", "1", "--lr_schedule", "step", "--lr_milestones", "100,150",
+ "--lr_gamma", "0.1", "--warmup_epochs", "0", "--momentum", "0.9",
+ "--weight_decay", "1e-4", "--normalization", "batchnorm",
+ "--output_lr", "0.1", "--alignment_probe", "32",
+ ]
+ jobs = [
+ ("dfa", common + [
+ "--mode", "dfa", "--lr", str(dfa["lr"]), "--a_scale", "1",
+ "--vectorizer_mode", "spatial_template",
+ "--out", "results/oral_a_dev/dfa_full_r20_s0.json"]),
+ ("sdil", common + [
+ "--mode", "sdil", "--lr", str(sdil["lr"]),
+ "--vectorizer_mode", sdil["vectorizer_mode"],
+ "--a_scale", str(sdil["a_scale"]), "--eta_A", str(sdil["eta_A"]),
+ "--a_warmup_steps", "100", "--pert_sigma", "0.01",
+ "--pert_directions", "1", "--pert_every", "4",
+ "--out", "results/oral_a_dev/sdil_full_r20_s0.json"]),
+ ]
+ os.makedirs("results/oral_a_dev", 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()