summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: