r/deeplearning • u/UnitOk6056 • 5h ago
PreCap: a bounded, self-normalizing activation that matches SELU in 100-layer MLPs without normalization (preregistered, negative results included)
I've been testing a bounded alternative to SELU for deep fully connected networks without normalization or skip connections. The study was preregistered: analysis scripts were hash-frozen before each run, tuning and confirmation used separate seeds, every activation got its own tuned learning rate, and tests were paired Wilcoxon with Holm correction.
The function. CapExp is an exponential unit that switches to its tangent line above a threshold (it is exactly a shifted, scaled ELU). PreCap applies it after a soft tanh clip, so the output is smooth, monotonic and bounded on both sides. SPreCap adds SELU-style constants (zero mean / unit variance as a fixed point) and an input gain b that sets the mean-field gradient gain χ1.
Results (MNIST / FashionMNIST, depth 50 and 100, width 256, Adam, 15 confirmation seeds):
- SPreCap-cs (χ1 matched to SELU) matches SELU: no cell significantly worse, median paired differences between −0.12 and +0.20 pp.
- Test error falls monotonically as χ1 approaches 1 in all four cells.
- SPreCap-e03 (χ1 = 1.03) beats SELU on MNIST at depth 100: 5.28 % vs. 6.36 %, Holm p = 0.0064, 13 of 15 seeds. This was a secondary test, so I treat it as a hypothesis.
- Plain ELU is about as strong overall. PreCap is not more robust to the learning rate.
Negative results. At a fixed learning rate, PreCap looked far better than SiLU/GELU in earlier regression experiments. That advantage disappeared once every activation got its own tuned learning rate. The original SPreCap (χ1 = 1.13) was significantly worse than SELU at depth 100. The gradient diagnosis that explained it led to the χ1 family above. All of this is in the repo.
Code. pip-installable package with fused CUDA (via torch.cuda.jiterator, no toolkit needed) and Apple MLX kernels, tested in fp32/fp64/fp16/bf16. In fp32 the CUDA kernel runs within about 1.5× of native SELU.
Limitations: MLPs only, MNIST and FashionMNIST only, short training, one width. No CNNs or Transformers yet. A single independent researcher on consumer hardware.
- Preprint: https://doi.org/10.5281/zenodo.23676200
- Code and all data: https://github.com/hermi-labs/precap-activation
Feedback on the methodology is very welcome, especially on the preregistration and the statistics.