(N=50)
| 94 | |
| 95 | |
| 96 | def test_sigmoid_activation(N=50): |
| 97 | from numpy_ml.neural_nets.activations import Sigmoid |
| 98 | |
| 99 | N = np.inf if N is None else N |
| 100 | |
| 101 | mine = Sigmoid() |
| 102 | gold = expit |
| 103 | |
| 104 | i = 0 |
| 105 | while i < N: |
| 106 | n_dims = np.random.randint(1, 100) |
| 107 | z = random_tensor((1, n_dims)) |
| 108 | assert_almost_equal(mine.fn(z), gold(z)) |
| 109 | print("PASSED") |
| 110 | i += 1 |
| 111 | |
| 112 | |
| 113 | def test_softplus_activation(N=50): |
nothing calls this directly
no test coverage detected