Rank-Safe Variable-Projection Gauss-Newton / threshold_check.py

✓✓ Beats tuned baseline

Raw ⬇ ZIP
 1import json, torch, numpy as np
 2import rank_safe_vp_gn as m
 3torch.manual_seed(m.SEED+2)
 4x,y,xt,yt=m.make_data()
 5# Reuse the implementation while varying rank cutoff; record whether hidden steps work.
 6out={}
 7for rho in [1e-5,1e-4,1e-3,1e-2]:
 8    torch.manual_seed(m.SEED+2)
 9    out[str(rho)]=m.vp_gn(x,y,xt,yt,width=16,steps=20,rho=rho)
10print(json.dumps({k:{a:v for a,v in d.items() if a!='history'} for k,d in out.items()},indent=2))
11with open('threshold_results.json','w') as f: json.dump(out,f,indent=2)