GaussianActivation<T>
Models & Types · AiDotNet.ActivationFunctions
Implements the Gaussian activation function for neural networks.
Inheritance: ActivationFunctionBase<T> → GaussianActivation<T>
Implements: IFusedActivation
For Beginners
The Gaussian activation function is based on the bell-shaped curve that you might recognize from statistics (the “normal distribution” or “bell curve”).
Key properties of the Gaussian activation function:
- It outputs values between 0 and 1
- The highest output (1) occurs when the input is 0
- As inputs move away from 0 (either positive or negative), the output approaches 0
- It’s symmetric around the y-axis (f(-x) = f(x))
Unlike many other activation functions, Gaussian responds strongly to inputs near zero and weakly to inputs far from zero in either direction. This makes it useful for:
- Radial Basis Function (RBF) networks
- Pattern recognition tasks
- Problems where distance from a central point is important
The mathematical formula is: f(x) = exp(-x²)
Example
using AiDotNet.ActivationFunctions;
var activation = new GaussianActivation<double>();
double y = activation.Activate(0.5);
Console.WriteLine($"GaussianActivation: f(0.5) = {y:F4}");
Constructors
| Constructor | Summary |
|---|---|
GaussianActivation() |
Methods
| Method | Summary |
|---|---|
T Activate(T input) |
Applies Gaussian to a tensor via engine primitives so the gradient tape records every step of exp(-x²). |
T Derivative(T input) |
Calculates the derivative of the Gaussian function for a single input value. |
Tensor<T> Activate(Tensor<T> input) |
Applies Gaussian to a tensor via engine primitives so the gradient tape records every step of exp(-x²). |