GaussianNoiseLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
A neural network layer that adds random Gaussian noise to inputs during training.
Inheritance: LayerBase<T> → GaussianNoiseLayer<T>
Implements: IShapeContract
For Beginners
This layer adds random “static” to your data during training to make the network more robust.
Think of it like training an athlete in challenging conditions:
- Training in rain and wind makes athletes perform better even in good weather
- Training with noise makes neural networks perform better on clean data
For example, in image recognition:
- During training: The layer slightly changes pixel values randomly
- This forces the network to focus on important patterns, not tiny details
- During testing/prediction: No noise is added, giving clean results
Gaussian noise is particularly useful because it follows the same distribution as many natural variations in real-world data.
How It Works
Gaussian noise layers help prevent overfitting by adding random noise to the input data. This forces the network to learn more robust features that can withstand small variations. The noise follows a Gaussian (normal) distribution with a specified mean and standard deviation. During inference (testing/prediction), no noise is added to preserve predictable outputs.
Constructors
| Constructor | Summary |
|---|---|
GaussianNoiseLayer(double standardDeviation, double mean) |
Initializes a new instance of the GaussianNoiseLayer class. |
Properties
| Property | Summary |
|---|---|
bool SupportsGpuTraining { get; } |
|
bool SupportsTraining { get; } |
Gets a value indicating whether this layer supports training. |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
Derived from this type’s [TensorLayout] declarations. |
void ResetState() |
Resets the internal state of the layer. |