📜  Sigmoid 素数 Python 代码示例

📅  最后修改于: 2022-03-11 14:46:01.246000             🧑  作者: Mango

代码示例1
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)