summaryrefslogtreecommitdiff
path: root/experiments/residual_mirror_full_development.py
diff options
context:
space:
mode:
authorYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 13:58:30 -0500
committerYurenHao0426 <Blackhao0426@gmail.com>2026-07-22 13:58:30 -0500
commit8a5c1045a43b1f91fd46b2fcc044b032cb14718c (patch)
tree2445eb08f8b12146945fd2fb60290149d0690093 /experiments/residual_mirror_full_development.py
parent80ead0dcdc410281894956402c08a2a26da63434 (diff)
protocol: implement residual mirror full gate
Diffstat (limited to 'experiments/residual_mirror_full_development.py')
-rwxr-xr-xexperiments/residual_mirror_full_development.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/experiments/residual_mirror_full_development.py b/experiments/residual_mirror_full_development.py
new file mode 100755
index 0000000..adba032
--- /dev/null
+++ b/experiments/residual_mirror_full_development.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python3
+"""Run the single frozen RRM-3 full ResNet-20 validation baseline."""
+import argparse
+import json
+import os
+import subprocess
+import sys
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "--selection", default="results/residual_mirror_short_gate.json")
+ parser.add_argument("--device", default="cuda")
+ parser.add_argument("--dry_run", action="store_true")
+ args = parser.parse_args()
+ with open(args.selection) as handle:
+ selection = json.load(handle)
+ if selection.get("protocol") != "residual_response_mirror_short_v1":
+ raise ValueError("unexpected RRM-2 selection protocol")
+ if selection.get("status") != "passed":
+ raise ValueError("RRM-2 did not open RRM-3")
+ rate = float(selection["selected_rrm"]["lr"])
+ if rate != 0.1:
+ raise ValueError("RRM-2 selected an unexpected hidden rate")
+
+ command = [
+ sys.executable, "experiments/conv_run.py", "--mode", "rrm",
+ "--device", args.device, "--depth", "20", "--width", "16",
+ "--seed", "0", "--loader_seed", "0", "--batch_size", "128",
+ "--epochs", "200", "--train_limit", "0",
+ "--val_examples", "5000", "--split_seed", "2027",
+ "--eval_split", "validation", "--eval_every", "0",
+ "--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",
+ "--lr", str(rate), "--output_lr", "0.1", "--a_scale", "1",
+ "--alignment_probe", "32", "--mirror_warmup_steps", "20",
+ "--mirror_every", "16", "--mirror_batch_size", "1",
+ "--mirror_eta", "0.1", "--mirror_noise_std", "1",
+ "--mirror_seed", "3000",
+ "--out", "results/residual_mirror_full/rrm.json",
+ ]
+ os.makedirs("results/residual_mirror_full", exist_ok=True)
+ print(" ".join(command), flush=True)
+ if not args.dry_run:
+ subprocess.run(command, check=True)
+
+
+if __name__ == "__main__":
+ main()