diff tests/test_sigmoid.py @ 42:38aa9098bf2d

derivative of sigmoid
author Jeff Hammel <k0scist@gmail.com>
date Mon, 04 Sep 2017 14:34:00 -0700
parents d6d2ecb33c95
children
line wrap: on
line diff
--- a/tests/test_sigmoid.py	Mon Sep 04 14:31:25 2017 -0700
+++ b/tests/test_sigmoid.py	Mon Sep 04 14:34:00 2017 -0700
@@ -6,7 +6,7 @@
 
 import os
 import unittest
-from tvii.sigmoid import sigmoid
+from tvii.sigmoid import sigmoid, sigmoidprime
 
 
 class TestSigmoid(unittest.TestCase):
@@ -19,5 +19,9 @@
         assert answer[0] == 0.5
         assert abs(answer[1] - 0.88079708) < 1e-6
 
+    def test_derivative(self):
+
+        self.assertAlmostEqual(sigmoidprime(0), 0.25)
+
 if __name__ == '__main__':
     unittest.main()