BatchNormDataLayout
Enums · AiDotNet.NeuralNetworks.Layers
How BatchNormalizationLayer should interpret a rank-3 input.
For Beginners
“channels” are the feature maps a convolution produces. Batch norm has to normalize each channel separately, so it needs to know which position in the shape the channels live in. For a batch of audio the order is usually [batch, channels, time]; for a single image it is [channels, height, width]. Both are three numbers, so the layer cannot tell which you meant – this lets you say.
How It Works
Rank 3 is ambiguous. [C, H, W] is an unbatched image with channels on axis 0;
[B, C, T] is a batched channels-first sequence with channels on axis 1. Nothing in the
shape distinguishes them, so the layer used to decide by testing whether the trailing axis
happened to equal the parameter count – a coincidence, not a fact, and one that silently
transposed ContextNet’s statistics when T equalled C.
Fields
| Field | Summary |
|---|---|
BatchNormDataLayout ChannelsFirst |
Channels are on axis 1 of a batched tensor: [B, C, ...]. |
BatchNormDataLayout ChannelsLast |
Channels are on the trailing axis: [B, ..., C]. |
BatchNormDataLayout Infer |
Historical behaviour: treat rank 3 as unbatched channels-first [C, H, W], and take the features-last flatten when the trailing axis equals the parameter count. |
int value__ |