summaryrefslogtreecommitdiff
path: root/experiments/residual_mirror_capture_screen.py
diff options
context:
space:
mode:
authorYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 13:48:59 -0500
committerYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 13:48:59 -0500
commit18aff5b55e3ad1f6e244ad25a8eae44f25f4e5c1 (patch)
tree9609157b6d52b61ef9b23a6229993927ae992a93 /experiments/residual_mirror_capture_screen.py
parent1e4fbaf8e773509798387d19b806f6daf38f8b5c (diff)
protocol: freeze residual mirror baseline funnel
Diffstat (limited to 'experiments/residual_mirror_capture_screen.py')
-rw-r--r--experiments/residual_mirror_capture_screen.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/experiments/residual_mirror_capture_screen.py b/experiments/residual_mirror_capture_screen.py
new file mode 100644
index 0000000..223a1db
--- /dev/null
+++ b/experiments/residual_mirror_capture_screen.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python3
+"""Run a shard of the frozen residual-response mirror 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", "--alignment_probe", "64",
+ "--mirror_batch_size", "1", "--mirror_noise_std", "1",
+ "--mirror_seed", "3000",
+ ]
+ jobs = [("fixed_hfa", common + [
+ "--mode", "hfa", "--out",
+ "results/residual_mirror_capture/fixed_hfa.json",
+ ])]
+ for rate in (0.03, 0.1, 0.3):
+ tag = f"rrm_etaM{rate}"
+ jobs.append((tag, common + [
+ "--mode", "rrm", "--mirror_eta", str(rate),
+ "--mirror_warmup_steps", "20", "--out",
+ f"results/residual_mirror_capture/{tag}.json",
+ ]))
+ os.makedirs("results/residual_mirror_capture", 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()
+