ByteDance-inspired binary prediction service produces logits that must be converted into probabilities for downstream decision logic. You need to implement the sigmoid transformation correctly, including large positive and negative inputs.
Convert logits to probabilities with the logistic sigmoid. The implementation must stay finite for very large positive and negative logits.
Implement solve(z).
Returns. Return a float NumPy array of the same shape with values in [0,1].
Example 1
Input:
solve([-1, 0, 1])
Output:
[0.268941, 0.5, 0.731059]
Example 2
Input:
solve([800.0, -800.0])
Output:
[1.0, 0.0]
No results yet
Run your code to check it against the examples, or submit to run every test.