MCPcopy
hub / github.com/ddbourgin/numpy-ml / test_sigmoid_activation

Function test_sigmoid_activation

numpy_ml/tests/test_nn_activations.py:96–110  ·  view source on GitHub ↗
(N=50)

Source from the content-addressed store, hash-verified

94
95
96def 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
113def test_softplus_activation(N=50):

Callers

nothing calls this directly

Calls 3

fnMethod · 0.95
SigmoidClass · 0.90
random_tensorFunction · 0.90

Tested by

no test coverage detected