FrozenBatchNormLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
Batch normalization fixed at its running statistics: y = (x − μ) / √(σ² + ε) · γ + β per channel, with μ, σ²,
γ and β all held constant — torchvision’s FrozenBatchNorm2d, for a pretrained network used as a fixed feature
extractor.
Inheritance: LayerBase<T> → FrozenBatchNormLayer<T>
Implements: IShapeContract
For Beginners
A pretrained network’s normalization, frozen: it rescales each channel exactly as it did when the network was trained.
How It Works
The four statistics are persistent buffers (μ = 0, σ² = 1, γ = 1, β = 0 until a checkpoint is loaded), so the
layer behaves the same in training and evaluation and nothing in it is trained. Channels are axis 1 of an input of
rank 2 or more ([batch, channels, ...]).
Constructors
| Constructor | Summary |
|---|---|
FrozenBatchNormLayer(int channels, double epsilon) |
Creates the layer. |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
Derived from this type’s [TensorLayout] declarations. |
IReadOnlyList<ValueTuple<string, Tensor<T>>> GetRegisteredBuffers() |
|
void ResetState() |