Checks / ordering
BatchNorm / LayerNorm after activation
Check R05. Runs in the editor as you build, in CI through the
GitHub Action, and over the wire at
POST /api/v1/check. Milliseconds, before any GPU is billed.
warn
ordering
R05
| Trigger | A normalization layer is connected directly downstream of an activation (relu, gelu, swish, etc.). |
|---|---|
| Why | Normalization is meant to stabilize the pre-activation distribution. Applying it after activation breaks the assumption and shifts already-nonlinear features back toward zero mean. |
| Source | Ioffe & Szegedy 2015, BatchNorm places BN between Linear/Conv and the activation. |
Why it is not a lint you can ignore
A structural mistake does not fail at review time and it does not fail at import
time. It fails when the module is constructed on the training node, after the job was queued and
the dataset was downloaded. That is why this runs before the spend and not after it.
Run this check on your own model
Free, no account needed
Every check
41 structural checks: 6 guardrail gates and 35 architecture advisor rules. See the full catalogue.
← R04 Dead-end layer ยท R06 Dropout directly before BatchNorm →