From 125ffd3a74ccf0c4fc17c8762d3e953253e90b2d Mon Sep 17 00:00:00 2001 From: Joe Rivera Date: Mon, 7 Sep 2026 22:10:49 -0500 Subject: [PATCH] fix(coef_train): align native-surrogate default lr to the M10 corrected barrier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit train_native() hardcoded the surrogate refinement lr at 2e-4 — the pre-M10 value — which OVERRODE the C++ coef_trainer's own default when dispatching to the native backend. The M10 barrier fix (#61) made the IPC barrier steeper (b'' gains +1/d^2), so 2e-4 now overshoots and DEGRADES the trained policy: on the city scene (seed 0), trained reach falls 71% -> 26%. Retuned to 5e-5, matching libcvc's coef_train.h default (1e-4..1e-5 all recover; 5e-5 is mid-band). The bicycle path keeps its own 1e-5. The torch imitation trainer (lr=1e-3) and scripts/train_on_geometry.py (lr=3e-4) are different regimes not covered by the surrogate sweep and are left unchanged pending their own validation. See the training guide's corrected-barrier section. --- grl_snam/tools/coef_train.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grl_snam/tools/coef_train.py b/grl_snam/tools/coef_train.py index 96adcbe..184b833 100644 --- a/grl_snam/tools/coef_train.py +++ b/grl_snam/tools/coef_train.py @@ -365,7 +365,11 @@ def train_native(out, *, grid=96, steps=400, rollout="surrogate", use_cuda=False story = shrunk(STORIES["city"], n=grid, max_steps=100) meta = story.meta() if lr is None: - lr = 1e-5 if str(rollout).lower() == "bicycle" else 2e-4 + # Mirror the C++ coef_trainer defaults (libcvc cvc/nav/coef_train.h). M10: + # the corrected (steeper) IPC barrier made the old surrogate lr 2e-4 overshoot + # and DEGRADE the policy (city seed-0 trained reach 71%->26%); retuned to 5e-5 + # (1e-4..1e-5 all recover; 5e-5 sits mid-band). The bicycle keeps its own 1e-5. + lr = 1e-5 if str(rollout).lower() == "bicycle" else 5e-5 return nav_native.train_coef_mlp( story.truth_grid().astype(np.uint8), out,