📅  最后修改于: 2022-03-11 14:46:01.246000             🧑  作者: Mango
class Sigmoid:
def __call__(self, z):
"""
Compute the sigmoid of z
Arguments:
z -- scalar or numpy array of any size.
Return:
sigmoid(z)
"""
sigmoid = 1/np.exp(-z)
return sigmoid
def prime(self, z): # Questions need some help --- Thanks!
"""
Compute the derivative of sigmoid of z
Arguments:
z -- scalar or numpy array of any size.
Return:
Sigmoid prime
"""
###return sigmoid * (1 - sigmoid)