Created
April 1, 2019 20:22
-
-
Save curiousily/dda9d88a4a370e8af830cc1733ddd4fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestLoss(unittest.TestCase): | |
def test_zero_h_zero_y(self): | |
self.assertAlmostEqual(loss(h=np.array([0]), y=np.array([0])), 0) | |
def test_one_h_zero_y(self): | |
self.assertAlmostEqual(loss(h=np.array([1]), y=np.array([0])), 0.5) | |
def test_two_h_zero_y(self): | |
self.assertAlmostEqual(loss(h=np.array([2]), y=np.array([0])), 2) | |
def test_zero_h_one_y(self): | |
self.assertAlmostEqual(loss(h=np.array([0]), y=np.array([1])), 0.5) | |
def test_zero_h_two_y(self): | |
self.assertAlmostEqual(loss(h=np.array([0]), y=np.array([2])), 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment