Created
September 7, 2017 00:35
-
-
Save f0nzie/61a092285fe0ffdf08b8a2f5bbbc5ed1 to your computer and use it in GitHub Desktop.
Compute the sigmoid of x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sigmoid(x): | |
""" | |
Compute the sigmoid of x | |
Arguments: | |
x -- A scalar or numpy array of any size | |
Return: | |
s -- sigmoid(x) | |
""" | |
### START CODE HERE ### (≈ 1 line of code) | |
s = 1 / ( 1 + np.exp(-x)) | |
### END CODE HERE ### | |
return s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment