summaryrefslogtreecommitdiff
path: root/ep_run/casc_eq_train.py
diff options
context:
space:
mode:
authorYuren Hao <yurenh2@illinois.edu>2026-07-19 08:33:17 -0500
committerYuren Hao <yurenh2@illinois.edu>2026-07-19 08:33:17 -0500
commite7aa2e3325904e20c17ddbd3ff62a5ea1304fa91 (patch)
tree8c65be9f0b98dfcf2280dcc4e2a20e15d66c75bb /ep_run/casc_eq_train.py
parent3a6b470a3c1094ccafd319a06b6a75bd822b1f2b (diff)
beta_servo: 贴上界伺服(亮区反演cap*=servo·cap_rho/ρ̂双向一步落点,暗区复用ride爬升;常数仅0.8安全系数) — 开火证书:plain s195000死亡区2.5k步CERT_PASS(β双向移动25/26行,best 3.5703→3.4260,零崩溃;贴边开销+50%墙钟为最恶劣工况); fw72m_servo王冠从头跑已发射(servo+ride4+cap_floor0+wsync3)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn
Diffstat (limited to 'ep_run/casc_eq_train.py')
-rw-r--r--ep_run/casc_eq_train.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/ep_run/casc_eq_train.py b/ep_run/casc_eq_train.py
index b3239f1..3000461 100644
--- a/ep_run/casc_eq_train.py
+++ b/ep_run/casc_eq_train.py
@@ -68,6 +68,13 @@ ap.add_argument('--drift_adapt', type=float, default=0.0) # >0: adaptive drift
ap.add_argument('--beta_cap_rho', type=float, default=0.0) # >0: LOOP-GAIN CAP on beta — if per-sweep residual
# ratio rho^ exceeds this, bscale *= 0.8 (beta backs off
# under the wall-2 ceiling); recovers x1.02 when rho^ low
+ap.add_argument('--beta_servo', type=float, default=0.0) # >0: CEILING-HUGGING SERVO. Meter lit (res above the
+ # v2 absolute gate): deadbeat inversion onto the ceiling
+ # — cap *= servo*cap_rho/rho^ (rho ~= G*beta near the
+ # edge, so one step lands beta at servo*ceiling; grows
+ # toward it when under, shrinks when over). Meter dark:
+ # existing ride climb probes upward. Value = safety
+ # fraction of the ceiling to sit at (canonical 0.8).
ap.add_argument('--wsync', type=int, default=0) # >0: SYNCHRONOUS WEIGHT-STEP ACCEPTANCE — snapshot
# params+momentum before each opt.step; next step's
# nudged relax measures the new state through the SAME
@@ -577,7 +584,11 @@ def ep_step(x, y):
if args.ride_ema > 0: # ride-v2(b), opt-in: smooth the meter before decisions
rho_use = GOV['rho_ema'] = 0.9 * GOV.get('rho_ema', rho_g) + 0.1 * rho_g
GOV['cool'] = max(GOV.get('cool', 0) - 1, 0)
- if res_g > 0.02 and rho_use > args.beta_cap_rho:
+ if args.beta_servo > 0 and res_g > 0.02 and rho_use > 0:
+ # meter lit -> INVERT onto the ceiling (both directions), replacing the AIMD attack
+ GOV['cap'] = min(max(GOV.get('cap', 1.0) * (args.beta_servo * args.beta_cap_rho / rho_use),
+ args.cap_floor), args.beta_ride)
+ elif res_g > 0.02 and rho_use > args.beta_cap_rho:
GOV['cap'] = max(GOV.get('cap', 1.0) * 0.85, args.cap_floor) # attack (gentler than v1)
if args.ride_cool > 0: GOV['cool'] = args.ride_cool # ride-v2(c), opt-in
elif (res_g < 0.01 or rho_use < 0.5 * args.beta_cap_rho) and GOV['cool'] == 0: