(N=15)
| 399 | |
| 400 | |
| 401 | def test_sigmoid_activation(N=15): |
| 402 | from numpy_ml.neural_nets.activations import Sigmoid |
| 403 | |
| 404 | np.random.seed(12345) |
| 405 | |
| 406 | N = np.inf if N is None else N |
| 407 | |
| 408 | mine = Sigmoid() |
| 409 | gold = expit |
| 410 | |
| 411 | i = 0 |
| 412 | while i < N: |
| 413 | n_dims = np.random.randint(1, 100) |
| 414 | z = random_tensor((1, n_dims)) |
| 415 | assert_almost_equal(mine.fn(z), gold(z)) |
| 416 | print("PASSED") |
| 417 | i += 1 |
| 418 | |
| 419 | |
| 420 | def test_elu_activation(N=15): |
nothing calls this directly
no test coverage detected