mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 23:11:09 +00:00
test: Add two testcases in sigmid.py
This commit is contained in:
parent
adda95ea58
commit
17264a496b
|
@ -29,6 +29,12 @@ def sigmoid(vector: np.ndarray) -> np.ndarray:
|
||||||
|
|
||||||
>>> sigmoid(np.array([0.0]))
|
>>> sigmoid(np.array([0.0]))
|
||||||
array([0.5])
|
array([0.5])
|
||||||
|
|
||||||
|
>>> sigmoid(np.array([100.0]))
|
||||||
|
array([1.])
|
||||||
|
|
||||||
|
>>> sigmoid(np.array([-100.0]))
|
||||||
|
array([3.72007598e-44])
|
||||||
"""
|
"""
|
||||||
return 1 / (1 + np.exp(-vector))
|
return 1 / (1 + np.exp(-vector))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user