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

Function test_sigmoid_activation

numpy_ml/tests/test_nn.py:401–417  ·  view source on GitHub ↗
(N=15)

Source from the content-addressed store, hash-verified

399
400
401def 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
420def test_elu_activation(N=15):

Callers

nothing calls this directly

Calls 3

fnMethod · 0.95
SigmoidClass · 0.90
random_tensorFunction · 0.90

Tested by

no test coverage detected