Beispiel #1
0
    def test1(self):
        x_hat = np.array([0.999])

        print("diff: ",
              np.log(x_hat) - np.array([student_ln(x) for x in x_hat]))
        assert np.all(
            np.abs(np.log(x_hat) - np.array([student_ln(x)
                                             for x in x_hat])) < EPSILON)
Beispiel #2
0
 def test3(self):
     assert float('-inf') == student_ln(0)
Beispiel #3
0
 def test2(self):
     assert np.abs(student_ln(np.e) - 1.0) < EPSILON
Beispiel #4
0
 def test1(self):
     x_hat = np.array([10, 20, 30])
     assert np.all(
         np.abs(np.log(x_hat) - np.array([student_ln(x)
                                          for x in x_hat])) < EPSILON)