An activation function is a nonlinear function applied after the linear computation in each layer of a neural network.
Introducing this nonlinearity allows a neural network to learn complex patterns in the input data. Nonlinearity is necessary because most real-world problems are not linearly separable.
With this nonlinear function, the optimization landscape changes from a simple flat shape into a more complex, "curved" one.
(When the activation function is linear, the optimization landscape tends to be simple and flat.)
- Typical properties of an activation function
- It should add nonlinear curvature to the optimization landscape to improve training convergence of the network.
- It should not excessively increase the computational complexity of the model.
- It should not hinder gradient flow during training.
- It should preserve the distribution of the data to promote better training of the network.

