In machine learning and deep learning, the activation function sometimes uses the Sigmoid function.
This article will introduce in detail:
- Use python package matplotlib to draw Sigmoid function graph
- Sigmoid function detailed derivation process
- Two methods of seeking extreme value of Sigmoid function
Sigmoid function:
One, use the python package matplotlib to draw the Sigmoid function graph
1. The python code for drawing Sigmoid graphics is as follows:
import numpy as np
import matplotlib.pyplot as plt
def sigmoid(x):
return 1/(1+np.exp(-x))
x = np.arange(-5., 5., 0.2)
y = sigmoid(x)
plt.grid(True)
plt.plot(x, y)