# HG changeset patch # User Jeff Hammel # Date 1504481923 25200 # Node ID bf8bd42f8cd7661c7cc0460de91255f78376597f # Parent b95fe82ac9ce94030904ab4fadb170fda1dae9f2 [sigmoid] use numpy + add docstring diff -r b95fe82ac9ce -r bf8bd42f8cd7 tvii/sigmoid.py --- a/tvii/sigmoid.py Sun Sep 03 13:17:33 2017 -0700 +++ b/tvii/sigmoid.py Sun Sep 03 16:38:43 2017 -0700 @@ -2,7 +2,9 @@ sigmoid function: 1/(1 + e^-z) """ -import math +import numpy as np + def sigmoid(z): - return 1./(1. + math.exp(-z)) + """https://en.wikipedia.org/wiki/Sigmoid_function""" + return 1./(1. + np.exp(-z))