Applies sigmoid activation function. return normalized values >>> sigmoid(np.array(([1, 0, 2], [1, 0, 0]), dtype=np.float64)) array([[0.73105858, 0.5 , 0.88079708], [0.73105858, 0.5 , 0.5 ]])
(value: np.ndarray)
| 224 | |
| 225 | |
| 226 | def sigmoid(value: np.ndarray) -> np.ndarray: |
| 227 | """ |
| 228 | Applies sigmoid activation function. |
| 229 | |
| 230 | return normalized values |
| 231 | |
| 232 | >>> sigmoid(np.array(([1, 0, 2], [1, 0, 0]), dtype=np.float64)) |
| 233 | array([[0.73105858, 0.5 , 0.88079708], |
| 234 | [0.73105858, 0.5 , 0.5 ]]) |
| 235 | """ |
| 236 | return 1 / (1 + np.exp(-value)) |
| 237 | |
| 238 | |
| 239 | def sigmoid_derivative(value: np.ndarray) -> np.ndarray: |
no outgoing calls
no test coverage detected