In this article, we will look at the python function to calculate the derivative of the sigmoid activation function.
Sigmoid Activation Function is one of the widely used activation functions in deep learning. As its name suggests the curve of the sigmoid function is S-shaped.
Sigmoid transforms the values between the range 0 and 1.
The Mathematical function of the sigmoid function is:
In python, we can create a sigmoid activation function as,
# Sigmoid Activation Function def sigmoid(x): return 1/(1+np.exp(-x))
Derivative of the sigmoid is:
In Python, we can obtain the derivative of the activation function as,
# Derivative of Sigmoid def der_sigmoid(x): return sigmoid(x) * (1- sigmoid(x))
Let us see the plot for both the Sigmoid activation function and its derivative.
to read more about activation functions - link
Post a Comment