summaryrefslogtreecommitdiff
path: root/ep_run
diff options
context:
space:
mode:
Diffstat (limited to 'ep_run')
-rw-r--r--ep_run/casc_eq_train.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ep_run/casc_eq_train.py b/ep_run/casc_eq_train.py
index 8e3ec67..10e3515 100644
--- a/ep_run/casc_eq_train.py
+++ b/ep_run/casc_eq_train.py
@@ -54,6 +54,8 @@ ap.add_argument('--ddp_grad_test', action='store_true') # one-step grad equival
ap.add_argument('--beta_ride', type=float, default=1.0) # cap ceiling: >1 lets the governor RAISE beta
# above the schedule, up to ride x schedule
ap.add_argument('--beta_ride_up', type=float, default=1.02) # per-step climb rate in the calm branch
+ap.add_argument('--ride_ema', type=int, default=0) # ride-v2(b): rho-EMA before governor decisions
+ap.add_argument('--ride_cool', type=int, default=0) # ride-v2(c): post-attack climb cooldown (steps)
ap.add_argument('--drift_adapt', type=float, default=0.0) # >0: adaptive drift ceiling = this x trailing
# accepted-drift EMA (floor 0.05, cap 0.5);
# blocks beta-scaled garbage accepts (ride-v2d)
@@ -495,12 +497,14 @@ def ep_step(x, y):
res_g = ddp_bcast_scalar(GOV.get('res', 0.0))
# v2: ABSOLUTE-SCALE GATE — rho is only meaningful when the residual is above the noise
# floor; at tiny residuals rho ~ noise/noise ~ 1 and v1 starved beta to the cap floor.
- rho_e = GOV['rho_ema'] = 0.9 * GOV.get('rho_ema', rho_g) + 0.1 * rho_g # ride-v2(b): smooth the meter
+ rho_use = rho_g
+ 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_e > args.beta_cap_rho:
+ if res_g > 0.02 and rho_use > args.beta_cap_rho:
GOV['cap'] = max(GOV.get('cap', 1.0) * 0.85, 0.05) # attack (gentler than v1)
- GOV['cool'] = 200 # ride-v2(c): no re-climb for 200 steps
- elif (res_g < 0.01 or rho_e < 0.5 * args.beta_cap_rho) and GOV['cool'] == 0:
+ 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:
# recover; with beta_ride > 1 the governor CLIMBS past the schedule — beta finds
# its own ceiling and hovers there (ride-the-ceiling; 1.0 = legacy defensive cap)
GOV['cap'] = min(GOV.get('cap', 1.0) * args.beta_ride_up, args.beta_ride)