Compute the logistic sigmoid σ(x)=1/(1+e−x) for an array of real logits without overflow for large positive or negative inputs.
Implement solve(x).
Returns. Return a float NumPy array of the same shape with values in [0,1].
Example 1
Input:
solve([0.0])
Output:
[0.5]
Example 2
Input:
solve([2.0, -2.0])
Output:
[0.880797, 0.119203]
Example 3
Input:
solve([1000.0, -1000.0])
Output:
[1.0, 0.0]
No results yet
Run your code to check it against the examples, or submit to run every test.