diff tvii/sigmoid.py @ 16:b95fe82ac9ce

more notes to self
author Jeff Hammel <k0scist@gmail.com>
date Sun, 03 Sep 2017 13:17:33 -0700
parents
children bf8bd42f8cd7
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tvii/sigmoid.py	Sun Sep 03 13:17:33 2017 -0700
@@ -0,0 +1,8 @@
+"""
+sigmoid function: 1/(1 + e^-z)
+"""
+
+import math
+
+def sigmoid(z):
+    return 1./(1. + math.exp(-z))