def fx(func, i, nodes, debug): if func is "sigm": res = nnlib.sigmoid(nodes[i]) elif func is "tanh": res = nnlib.hyper_tan(nodes[i]) log.d(debug, log.hl("f(%d) \t(%.2f)\t---> %s \t---> (%.2f) " %(i, nodes[i], func, res),2)) nodes[i] = res
def test_sigmoid(): assert nnlib.sigmoid(-1) > 0 assert nnlib.sigmoid(0) == 0.5 assert nnlib.sigmoid(1) < 1