Sigmoid Function
Easy
~10 min
code completion
The Sigmoid Function
The sigmoid function squashes any real number to the range (0, 1), making it interpretable as a probability:
Key properties:
In NumPy: 1 / (1 + np.exp(-z))
Your task:
Implement sigmoid(z) that applies the sigmoid function element-wise.
Example Tests
z=0 gives exactly 0.5
Input: {"z":0}
Expected: 0.5
Large positive z approaches 1
Input: {"z":100}
Expected: 1
Large negative z approaches 0
Input: {"z":-100}
Expected: 0