Mercurial > hg > tvii
changeset 17:bf8bd42f8cd7
[sigmoid] use numpy + add docstring
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 03 Sep 2017 16:38:43 -0700 |
parents | b95fe82ac9ce |
children | e92fc4a17336 |
files | tvii/sigmoid.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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))