def test_neural_learn_b(self): test_neural = Neural() test_neural.set_w1(2) test_neural.set_w2(3) test_neural.set_w3(4) test_neural.set_w4(5) test_neural.set_b(10) test_neural.set_i1(2) test_neural.set_i2(3) test_neural.set_i3(4) test_neural.set_i4(5) test_neural.set_target(100) result = 10.00072 self.assertEqual(test_neural.learn_b(), result)
def test_neural_cal_cost(self): test_neural = Neural() test_neural.set_w1(2) test_neural.set_w2(3) test_neural.set_w3(4) test_neural.set_w4(5) test_neural.set_b(10) test_neural.set_i1(2) test_neural.set_i2(3) test_neural.set_i3(4) test_neural.set_i4(5) test_neural.set_target(100) result = 1296 self.assertEqual(test_neural.cal_cost(), result)
def test_neural_dcost_db(self): test_neural = Neural() test_neural.set_w1(2) test_neural.set_w2(3) test_neural.set_w3(4) test_neural.set_w4(5) test_neural.set_b(10) test_neural.set_i1(2) test_neural.set_i2(3) test_neural.set_i3(4) test_neural.set_i4(5) test_neural.set_target(100) result = -72 self.assertEqual(test_neural.dcost_db(), result)