Mathematical function sigmoid takes a vector x of K real numbers as input and returns 1/ (1 + e^-x). https://en.wikipedia.org/wiki/Sigmoid_function >>> sigmoid(np.array([-1.0, 1.0, 2.0])) array([0.26894142, 0.73105858, 0.88079708])
(vector: np.ndarray)
| 19 | |
| 20 | |
| 21 | def sigmoid(vector: np.ndarray) -> np.ndarray: |
| 22 | """ |
| 23 | Mathematical function sigmoid takes a vector x of K real numbers as input and |
| 24 | returns 1/ (1 + e^-x). |
| 25 | https://en.wikipedia.org/wiki/Sigmoid_function |
| 26 | |
| 27 | >>> sigmoid(np.array([-1.0, 1.0, 2.0])) |
| 28 | array([0.26894142, 0.73105858, 0.88079708]) |
| 29 | """ |
| 30 | return 1 / (1 + np.exp(-vector)) |
| 31 | |
| 32 | |
| 33 | def sigmoid_linear_unit(vector: np.ndarray) -> np.ndarray: |
no outgoing calls
no test coverage detected