Beispiel #1
0
def test_basic_eq_v():
    x = RD.logistic(RD(3))
    v = RD.logistic(RD(3))
    assert x==v, Exception(f'test_basic_eq_v() has error.')
Beispiel #2
0
def test_basic_ne_v():
    x = RD.logistic(RD(3))
    v = RD.logarithm(RD.logistic(RD(3)), np.e)
    assert x!=v, Exception(f'test_basic_ne_v() has error.')
Beispiel #3
0
def test_basic_logistic_v():
    x = RD(3) 
    derivative = RD.logistic(x)
    assert (float(derivative.val) == 1/(1 + np.e**(-3))) & (float(x.get_gradient()) == (np.e**(3))/(1 + np.e**3)), Exception(f'test_basic_logistic_v() has error.')