Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

a sigmoid function

import numpy as np
def sigmoid(x):
    """
    Compute the sigmoid of x

    Arguments:
    x -- A scalar or numpy array of any size

    Return:
    s -- sigmoid(x)
    """
    
    # (≈ 1 line of code)
    # s = 
    # YOUR CODE STARTS HERE
    s=1/(1+np.exp(-x))
    
    # YOUR CODE ENDS HERE
    
    return s
 
PREVIOUS NEXT
Tagged: #sigmoid #function
ADD COMMENT
Topic
Name
9+4 =