Beispiel #1
0
 def complex(a):
     return (
         operators.log(
             operators.sigmoid(
                 operators.relu(operators.relu(a * 10 + 7) * 6 + 5) * 10
             )
         )
         / 50
     )
Beispiel #2
0
def test_sigmoid(z):
    if z >= 0:
        assert operators.sigmoid(z) == 1.0 / (1.0 + math.exp(-z))
    else:
        assert operators.sigmoid(z) == math.exp(z) / (1.0 + math.exp(z))
 def sig(a):
     return operators.sigmoid(a)
Beispiel #4
0
def test_other(a):
    """
    Write a test that ensures some other property holds for your functions.
    """
    assert a == operators.neg(operators.neg(a))
    assert_close(operators.sigmoid(-a), 1 - operators.sigmoid(a))
Beispiel #5
0
 def sig(a):
     "Apply sigmoid"
     return operators.sigmoid(a)