diff --git a/tools/elm_bench/README.md b/tools/elm_bench/README.md index bb3b844..9d89eee 100644 --- a/tools/elm_bench/README.md +++ b/tools/elm_bench/README.md @@ -1185,3 +1185,68 @@ finding — a single linear feature is.** (b) hyper-parameter selection is on the reporting folds; (c) the whole bench never tests the premise that predicting an opponent's aim error improves *our* shots; (d) Dookious remains a genuine counterexample. + +--- + +# ACTIVATION SWEEP (tanh / relu / step) + +`bench_realistic.nim argv[2]` selects the hidden activation; features, folds, +grid and seed are unchanged, so the three runs are directly comparable. +Full grid, 5 round-group folds, best config per activation on ALL-21 +(`act_sweep.log`). + +| activation | best cfg | mean per-fold RMSE | pooled RMSE / MAE / medAE | Δ vs constant | vs tanh | +|---|---|---|---|---|---| +| **tanh** (default) | H=128 λ=1e-2 d=1.0 | **0.4218** | 0.4220 / 0.1824 / 0.1095 | **−0.7187** | — | +| relu | H=128 λ=1e2 d=1.0 | 0.4338 | 0.4340 / 0.1845 / 0.1171 | −0.7068 | +2.8% | +| step | H=128 λ=1e0 d=1.0 | 0.7476 | 0.7503 / 0.5181 / 0.3714 | −0.3930 | +77.3% | +| *constant baseline* | — | *1.1406* | *1.1463* | — | — | + +Same picture on the smaller feature sets (mean per-fold RMSE): + +| features | tanh | relu | step | +|---|---|---|---| +| ALL 21 | 0.4218 | 0.4338 | 0.7476 | +| believed base 7 | 0.7800 | 0.7840 | 0.8157 | +| belief geom only (base 6) | 1.1310 | 1.1308 | 1.1329 | +| scan-age only (4 features) | 1.1395 | 1.1395 | 1.1397 | + +Reading: + +* **The activation does not matter much, and where it does it is exactly where + the theory says.** On base 6 and on scan-age alone all three are within + 0.0002 of each other and all three are worthless — those tasks have no + nonlinear structure for `g` to expose. The spread only opens up on the full + 21-feature set, and there tanh wins by 2.8% over relu and 77% over step. +* **step loses badly (−77%) and relu is close to tanh, for one reason:** the + pre-activations are roughly symmetric about 0, so a step unit fires half the + time and emits a constant. Its Gram matrix is nearly rank-`L/2` and the + output weights needed to compensate are large. relu keeps one side of the + nonlinearity and is therefore much closer. This mirrors the interpolation + numbers in `modules/ELM/README.md` (20 samples in 20 nodes: tanh 5.2e-10, + relu 4.0e-12, step 2.3e-13 — all exact — but held-out MSE at λ=1e-8 is + 1.1e-06 / 3.5e-02 / 8.4e-02, i.e. step is the one that fails to + generalise). +* **Practical consequence: keep tanh as the default.** The result does not + change either way (the ridge law in §4 reproduces the headline to within + 1.6 points without any network at all), but tanh is never worse and is the + configuration every other number in this README was produced with. + +### Why there is still no RBF/gaussian activation + +Adding one is not a `g` swap. The classic RBF-ELM hidden unit is +`g(b·‖x − a‖)`: the activation reads the **distance to a centre in input +space**, so the hidden layer has to store centres plus per-node widths (the +width normally coming from the data, e.g. a mean over nearest-neighbour +distances). That changes what `W` and `hs` mean, how they are initialised, and +the conditioning argument behind `initElm`; it is a different node +architecture, not a different nonlinearity. + +The short version of why it would not help here anyway: this task's signal is +one linear term (§5 — `label ≈ 0.8663 · beliefPredErr + 0.0418`, corr 0.92), +and a linear ridge already reproduces the ELM's headline to within 1.6 points. +A wider feature class buys nothing on a law that is already linear in one +variable; it would only buy more capacity to overfit the 40 round-groups. +Ship `0.87 × lead`, not a network. + +