summaryrefslogtreecommitdiff
path: root/ep_run/diag_cos.py
diff options
context:
space:
mode:
authorYuren Hao <yurenh2@illinois.edu>2026-07-03 07:57:22 -0500
committerYuren Hao <yurenh2@illinois.edu>2026-07-03 07:57:22 -0500
commitbcec9560cf5c9b113e9381a52d1a941daa8865f2 (patch)
treebae3baf6d742b816d90e642d70b9744a86a4d189 /ep_run/diag_cos.py
parentc0b507fb1760be291e1e1ed33f33fb18f16d8c2d (diff)
omega/norm-family refuted as stability signal; fingerprint story retracted; eigreg v2 = true map-eigenvalue (spec_penalty)HEADmaster
- eig_control: fix plain-PI bug (shifted PI for lambda_max of indefinite Sym); add lead_rho + spec_penalty (soft one-sided cap on |lam|(I+eps*J_F), 2-D Rayleigh-Ritz, matvec-only) โ€” aep 'spectral' ported. eig_penalty demoted to diagnostic. - eig_recheck.py (Lanczos audit): omega=+5..+13 on ALL operators incl the stablest (s2000 +12.8 while true alpha=-0.02); gap omega-alpha~10; old 'warm -10.14 vs scratch +1.11' numbers were PI-mixture artifacts. RETRACTED. - eig_v2_smoke/depth: v2 mechanics validated vs ARPACK; z_T1 readings >1 are unconverged-state contamination (150: 1.009 -> 400/800: 0.997-0.999, mu=-0.02..-0.006 matching eig_probe); fixed-point top = BAND of slow modes. - lt_ep_train: --eigreg now spec_penalty (--eig_margin 0.995 = rho target); --fingerprint reports rho/Re_mu instead of num_abscissa. - ONBOARDING ยง4-7 + FINDINGS 2026-07-03: retraction + verdict (fundamental quantity = finite-horizon path LE / resreg axis; de-cliff via floss-ept; spec_penalty = measure-mode scalpel for a detaching Hopf pair). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn
Diffstat (limited to 'ep_run/diag_cos.py')
-rw-r--r--ep_run/diag_cos.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/ep_run/diag_cos.py b/ep_run/diag_cos.py
index 37e7257..fb8a68f 100644
--- a/ep_run/diag_cos.py
+++ b/ep_run/diag_cos.py
@@ -9,7 +9,7 @@ can be laid side by side, and fingerprints any checkpoint (res, cos, numerical a
see WHAT distinguishes s2000 from other 2000-step checkpoints (conditioning? alignment? abscissa?)."""
import math, torch
from lt_ep_train import ep_step, bptt_step, relax, evaluate, get_batch
-from eig_control import num_abscissa
+from eig_control import lead_rho
def _cos(ge, gb, params): # cosine over the shared block params (where EP != BPTT)
@@ -32,14 +32,16 @@ def cos_ep_bptt(blk, idx, y, T1, T2, eps, beta, holo=0, hr=0.02, t1max=0, res_es
def fingerprint(blk, T1, T2, eps, beta, holo=0, hr=0.02, t1max=0, res_est=1e-4, t2sel=0, nb=4, B=6):
- """Median (res, cos-to-BPTT, numerical abscissa) over nb small batches + val CE โ€” the operator's 4-D fingerprint.
- B kept small: the exact-BPTT reference gradient unrolls T1 steps and is memory-heavy at C512."""
- cache = {}; res_l, cos_l, om_l = [], [], []
+ """Median (res, cos-to-BPTT, TRUE leading map-eigenvalue rho & Re mu) over nb small batches + val CE.
+ B kept small: the exact-BPTT reference gradient unrolls T1 steps and is memory-heavy at C512.
+ (The numerical-abscissa column was retracted 2026-07-03 โ€” omega is ~10 above the true abscissa on
+ this non-normal operator and anti-correlates with stability; see eig_control docstring / eig_recheck.)"""
+ cache = {}; res_l, cos_l, rho_l, mu_l = [], [], [], []
for _ in range(nb):
idx, y = get_batch('train', B, blk.T)
c, r = cos_ep_bptt(blk, idx, y, T1, T2, eps, beta, holo, hr, t1max, res_est, t2sel)
xin = blk.embed(idx).detach(); zs = relax(blk, xin.clone(), xin, T1, eps)
- _, om = num_abscissa(blk, zs, cache)
- res_l.append(r); cos_l.append(c); om_l.append(om)
+ _, rho, mu = lead_rho(blk, zs, eps, blk.c, cache, iters=25) # one-shot: more iters than the warm-started training path
+ res_l.append(r); cos_l.append(c); rho_l.append(rho); mu_l.append(mu)
md = lambda a: sorted(a)[len(a) // 2]
- return dict(res=md(res_l), cos=md(cos_l), num_abscissa=md(om_l), val=evaluate(blk, T1, eps))
+ return dict(res=md(res_l), cos=md(cos_l), rho=md(rho_l), mu_re=md(mu_l), val=evaluate(blk, T1, eps))