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):