diff options
Diffstat (limited to 'ep_run')
| -rw-r--r-- | ep_run/r_sweep.log | 15 | ||||
| -rw-r--r-- | ep_run/r_sweep.py | 30 |
2 files changed, 45 insertions, 0 deletions
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) |
