From 5975caf0f52355276aabec5ba8f144db9ac46619 Mon Sep 17 00:00:00 2001 From: Yuren Hao Date: Sun, 5 Jul 2026 05:12:34 -0500 Subject: =?UTF-8?q?r-sweep:=20cos(EP,BPTT)=20FLAT=20across=20r=3D0.02..0.4?= =?UTF-8?q?=20on=20both=20operators=20=E2=80=94=20nudge-SNR=20hypothesis?= =?UTF-8?q?=20refuted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 50% single-shot sensitivity is MULTIPLICATIVE (near-marginal T2 dynamics' state-sensitivity; signal and error scale with r together) — not additive noise divided by 2r. cos ceiling ~0.88 at near-edge states is set by T2 truncation + state sensitivity (0.98 at deeply-contracted states). hr-0.2's empirical wins are NOT estimator SNR. Hardware upside: algorithm indifferent to r across 20x -> nudge amplitude free to fight ADDITIVE readout noise. Surviving accuracy levers: kappa nbrake (Tikhonov, targets the real culprit), tail-window averaging over argmin selection. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn --- ep_run/r_sweep.log | 15 +++++++++++++++ ep_run/r_sweep.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 ep_run/r_sweep.log create mode 100644 ep_run/r_sweep.py (limited to 'ep_run') diff --git a/ep_run/r_sweep.log b/ep_run/r_sweep.log new file mode 100644 index 0000000..057b0eb --- /dev/null +++ b/ep_run/r_sweep.log @@ -0,0 +1,15 @@ +=== s2000 === +/home/yurenh2/miniconda3/lib/python3.13/site-packages/torch/autograd/graph.py:865: UserWarning: Attempting to run cuBLAS, but there was no current CUDA context! Attempting to set the primary context... (Triggered internally at /pytorch/aten/src/ATen/cuda/CublasHandlePool.cpp:330.) + return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass + r=0.02 cos=0.9068 0.8533 mean=0.8801 + r=0.05 cos=0.9127 0.8550 mean=0.8839 + r=0.1 cos=0.9129 0.8573 mean=0.8851 + r=0.2 cos=0.9127 0.8573 mean=0.8850 + r=0.4 cos=0.9131 0.8573 mean=0.8852 +=== fast-adaptive@2.18 === + r=0.02 cos=0.9242 0.8212 mean=0.8727 + r=0.05 cos=0.9245 0.8213 mean=0.8729 + r=0.1 cos=0.9242 0.8213 mean=0.8728 + r=0.2 cos=0.9242 0.8213 mean=0.8728 + r=0.4 cos=0.9243 0.8212 mean=0.8727 +R_SWEEP_DONE diff --git a/ep_run/r_sweep.py b/ep_run/r_sweep.py new file mode 100644 index 0000000..9e94107 --- /dev/null +++ b/ep_run/r_sweep.py @@ -0,0 +1,30 @@ +"""THE r-sweep (nudge-amplitude bias/variance dial): cos(EP,BPTT) vs r on two operators. +Estimator variance ~ (state noise / 2r)^2 amplified by the T2 dynamics (measured: 50% single-shot at +r=0.02); holomorphic bias ~ O(r^2). Winners (redx seed-maker, warm_fast record) ran hr=0.2; the +plateauing proven-scratch line ran hr=0.02 — if cos(r=0.2) >> cos(r=0.02), the default flips and part +of the 'recipe difference' story was estimator SNR all along. Track path, 2 batches per (ckpt, r).""" +import torch +import lt_ep_train as L +from diag_cos import cos_ep_bptt + +CKPTS = [('s2000', 'runs/redx_traj/s2000.pt'), ('fast-adaptive@2.18', 'runs/ep_fast_adaptive.pt')] +RS = [0.02, 0.05, 0.1, 0.2, 0.4] + +for name, path in CKPTS: + torch.manual_seed(0) + blk = L.EQBlock(512, 16, 256, 256, c=1.0, attn_mode='thick'); blk.qknorm = True + ck = torch.load(path, map_location=L.dev) + with torch.no_grad(): + for p, w in zip(blk.allp, ck['allp']): + p.copy_(w.to(L.dev)) + blk.track = True + torch.manual_seed(11) + batches = [L.get_batch('train', 24, 256) for _ in range(2)] + print(f"=== {name} ===", flush=True) + for r in RS: + cs = [] + for idx, y in batches: + c, _ = cos_ep_bptt(blk, idx, y, 150, 20, 0.1, 0.02, holo=2, hr=r, t2sel=40) + cs.append(c) + print(f" r={r:<5} cos={' '.join(f'{c:.4f}' for c in cs)} mean={sum(cs)/len(cs):.4f}", flush=True) +print("R_SWEEP_DONE", flush=True) -- cgit v1.2.3