# HG changeset patch # User Jeff Hammel # Date 1504464235 25200 # Node ID 8d25213513b4883753d654545b110ad29bef6cd2 # Parent b6a146f0a61b42df5d875fefc8b62f32a2257e3a [regression] notes to self diff -r b6a146f0a61b -r 8d25213513b4 tvii/logistic_regression.py --- a/tvii/logistic_regression.py Sun Sep 03 11:27:47 2017 -0700 +++ b/tvii/logistic_regression.py Sun Sep 03 11:43:55 2017 -0700 @@ -13,6 +13,10 @@ import numpy as np +def logistic_regression(_): + """the slow way""" + J = 0, dw1=0, dw2=0, db=0; + def logistic_regression(nx): dw = np.zeros(nx) # TODO @@ -22,3 +26,10 @@ # derivativs: # dz1 = a1 - y1 ; dz2 = a2 - y2 ; .... # dZ = [ dz1 dz2 ... dzm ] +# Z = w'X + b = np.dot(w', X) + b +# A sigmoid(Z) +#dZ = A - Y +#dw = (1./m)*X*dZ' +#db = (1./m)*np.sum(dZ) +# w -= alpha*dw +# b -= alpha*db