The sigmoid function can be thought of as an improvement of the threshold function. Here, we have control over the sensitivity of the activation function:
The sigmoid function, y, is defined as follows:
It can be implemented in Python as follows:
def sigmoidFunction(z): return 1/ (1+np.exp(-z))
Note that by reducing the sensitivity of the activation function, we make glitches in the input less disruptive. Note that the output of the sigmoid activation function is still binary, that is, 0 or 1.