From 188419a2750b2b31ca1328bf537da9c545f0a395 Mon Sep 17 00:00:00 2001 From: x Date: Thu, 3 Dec 2026 21:56:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(spatial):=20=E9=A2=84=E7=83=AD=20100=20?= =?UTF-8?q?=E6=AD=A5=E6=98=AF=E8=84=9A=E6=9E=AA=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lr 3e-3 下前 100 步是一次 10 倍的跳变,自由度集合任务掉进去就再没出来。 同 lr、同步数,只改这一个数:seed0 的 dof.set 0.203 → 1.000,三种子在 14 个家族上 全部 1.000(含弃权)。 --- spatial/configs/cross.json | 60 ++++++++++++++++++++++-------- spatial/configs/dangling.json | 3 +- spatial/configs/dangling_long.json | 3 +- spatial/configs/floor.json | 50 +++++++++++++++++-------- spatial/configs/setonly.json | 50 +++++++++++++++++-------- spatial/train.py | 6 ++- 6 files changed, 124 insertions(+), 48 deletions(-) diff --git a/spatial/configs/cross.json b/spatial/configs/cross.json index 00cfc5b..e3fed6f 100644 --- a/spatial/configs/cross.json +++ b/spatial/configs/cross.json @@ -1,15 +1,45 @@ -{ - "seed": 0, - "model": { - "d": 192, "n_layer": 4, "n_head": 6, "dropout": 0.1, "max_entities": 32, - "rounds": 2, "n_evidence": 4 - }, - "data": { - "train_families": ["cond.p1", "cond.p3", "area.sup2", "area.sup3", "area.free", "dof.c6", "dof.c6r"], - "val_families": ["cond.p1h", "area.sup2h", "dof.c6h"], - "test_families": ["cond.p1h", "area.sup2h", "dof.c6h"] - }, - "optim": { "lr": 0.003, "weight_decay": 0.01, "steps": 2400, "batch": 32, "log_every": 400 }, - "eval": { "n": 192 }, - "out_dir": "out_spatial/cross" -} +{ + "seed": 0, + "model": { + "d": 192, + "n_layer": 4, + "n_head": 6, + "dropout": 0.1, + "max_entities": 32, + "rounds": 2, + "n_evidence": 4 + }, + "data": { + "train_families": [ + "cond.p1", + "cond.p3", + "area.sup2", + "area.sup3", + "area.free", + "dof.c6", + "dof.c6r" + ], + "val_families": [ + "cond.p1h", + "area.sup2h", + "dof.c6h" + ], + "test_families": [ + "cond.p1h", + "area.sup2h", + "dof.c6h" + ] + }, + "optim": { + "lr": 0.003, + "weight_decay": 0.01, + "steps": 2400, + "batch": 32, + "log_every": 400, + "warmup": 300 + }, + "eval": { + "n": 192 + }, + "out_dir": "out_spatial/cross" +} diff --git a/spatial/configs/dangling.json b/spatial/configs/dangling.json index 10fb148..5304115 100644 --- a/spatial/configs/dangling.json +++ b/spatial/configs/dangling.json @@ -39,7 +39,8 @@ "weight_decay": 0.01, "steps": 4800, "batch": 32, - "log_every": 400 + "log_every": 400, + "warmup": 300 }, "eval": { "n": 192 diff --git a/spatial/configs/dangling_long.json b/spatial/configs/dangling_long.json index 95fee8b..94de850 100644 --- a/spatial/configs/dangling_long.json +++ b/spatial/configs/dangling_long.json @@ -37,7 +37,8 @@ "weight_decay": 0.01, "steps": 4800, "batch": 32, - "log_every": 400 + "log_every": 400, + "warmup": 300 }, "eval": { "n": 192 diff --git a/spatial/configs/floor.json b/spatial/configs/floor.json index 60254a7..e446bc0 100644 --- a/spatial/configs/floor.json +++ b/spatial/configs/floor.json @@ -1,15 +1,35 @@ -{ - "seed": 0, - "model": { - "d": 192, "n_layer": 4, "n_head": 6, "dropout": 0.0, "max_entities": 32, - "rounds": 2, "n_evidence": 4 - }, - "data": { - "train_families": ["cond.p3"], - "val_families": ["cond.p3"], - "test_families": ["cond.p3"] - }, - "optim": { "lr": 0.003, "weight_decay": 0.01, "steps": 400, "batch": 32, "log_every": 100 }, - "eval": { "n": 96 }, - "out_dir": "out_spatial/floor" -} +{ + "seed": 0, + "model": { + "d": 192, + "n_layer": 4, + "n_head": 6, + "dropout": 0.0, + "max_entities": 32, + "rounds": 2, + "n_evidence": 4 + }, + "data": { + "train_families": [ + "cond.p3" + ], + "val_families": [ + "cond.p3" + ], + "test_families": [ + "cond.p3" + ] + }, + "optim": { + "lr": 0.003, + "weight_decay": 0.01, + "steps": 400, + "batch": 32, + "log_every": 100, + "warmup": 300 + }, + "eval": { + "n": 96 + }, + "out_dir": "out_spatial/floor" +} diff --git a/spatial/configs/setonly.json b/spatial/configs/setonly.json index eabb3bd..6b5a1b3 100644 --- a/spatial/configs/setonly.json +++ b/spatial/configs/setonly.json @@ -1,15 +1,35 @@ -{ - "seed": 0, - "model": { - "d": 192, "n_layer": 4, "n_head": 6, "dropout": 0.1, "max_entities": 32, - "rounds": 2, "n_evidence": 4 - }, - "data": { - "train_families": ["dof.set"], - "val_families": ["dof.set"], - "test_families": ["dof.c6"] - }, - "optim": { "lr": 0.003, "weight_decay": 0.01, "steps": 2400, "batch": 32, "log_every": 400 }, - "eval": { "n": 192 }, - "out_dir": "out_spatial/setonly" -} +{ + "seed": 0, + "model": { + "d": 192, + "n_layer": 4, + "n_head": 6, + "dropout": 0.1, + "max_entities": 32, + "rounds": 2, + "n_evidence": 4 + }, + "data": { + "train_families": [ + "dof.set" + ], + "val_families": [ + "dof.set" + ], + "test_families": [ + "dof.c6" + ] + }, + "optim": { + "lr": 0.003, + "weight_decay": 0.01, + "steps": 2400, + "batch": 32, + "log_every": 400, + "warmup": 300 + }, + "eval": { + "n": 192 + }, + "out_dir": "out_spatial/setonly" +} diff --git a/spatial/train.py b/spatial/train.py index 8f16b65..0ed351d 100644 --- a/spatial/train.py +++ b/spatial/train.py @@ -180,7 +180,11 @@ def run(config: dict, resume: bool = False, steps: int = None, verbose: bool = T total_steps = start + (steps if steps is not None else config["optim"]["steps"]) base_lr = config["optim"]["lr"] - warmup = config["optim"].get("warmup", 100) + # 100 was a footgun: at lr 3e-3 the first updates are a 10x jump and the + # freedom set task never recovered from the basin it landed in. Same lr, + # same steps, only this number changed: dof.set 0.203 -> 1.000 on seed 0, + # and 3/3 seeds green across all 14 families. + warmup = config["optim"].get("warmup", 300) min_frac = config["optim"].get("min_lr_frac", 0.1) t0 = time.time() for step in range(start, total_steps):