Activation Functions
Activation Functions
In its simplest form, this function is binary, that is, the neuron is either firing or not.
The activation function defines the output of a neuron in terms of the induced local field.
Therefore, the output of the functions will not be confined between any range.
Draw graph with a cross-section touching the midpoint from left to right
Equation : f(x) = x
It does not help with the complexity or various parameters of usual data that is fed to the
neural networks.
The Nonlinear Activation Functions are the most used activation functions.
Nonlinearity helps to makes the graph look something like this (see next slide)
Non-linear activation function makes it easy for the model to generalize or adapt with
variety of data and to differentiate between the output
The Nonlinear Activation Functions are mainly divided on the basis of their range or
curves
Draw graph with s touching the top,middle and bottom (write formula (z)=1/1+e^-z)
The main reason why we use sigmoid function is because it exists between (0 to 1).
Therefore, it is especially used for models where we have to predict the probability as an
output.
Since probability of anything exists only between the range of 0 and 1, sigmoid is the right
choice.
The function is differentiable.That means, we can find the slope of the sigmoid curve at any
two points.
The logistic sigmoid function can cause a neural network to get stuck at the training time.
The softmax function is a more generalized logistic activation function which is used for
multiclass classification.
Draw graph with s touching the top,middle and bottom(from -1 to 1) and another slightly curved line
from o through 0.5 to 1. Label S as tanh and the latter as sigmoid.
The advantage is that the negative inputs will be mapped strongly negative and the zero
inputs will be mapped near zero in the tanh graph.
The tanh function is mainly used for classification between two classes.
Both tanh and logistic sigmoid activation functions are used in feed-forward nets.
The ReLU is the most used activation function in the world right now.
Since, it is used in almost all the convolutional neural networks or deep learning.
f(z) is zero when z is less than zero and f(z) is equal to z when z is above or equal to zero.
Range: [ 0 to infinity)
But the issue is that all the negative values become zero immediately which decreases the
ability of the model to fit or train from the data properly.
That means any negative input given to the ReLU activation function turns the value into
zero immediately in the graph, which in turns affects the resulting graph by not mapping the
negative values appropriately.
LEAKY RELU
Draw graph of relu f(y)=y then add a slight from x axisf(y)=ay to left