File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed
logistic_regression_class Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def sigmoid(z):
4141# calculate the cross-entropy error
4242def cross_entropy (T , Y ):
4343 E = 0
44- for i in xrange (N ):
44+ for i in xrange (len ( T ) ):
4545 if T [i ] == 1 :
4646 E -= np .log (Y [i ])
4747 else :
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def sigmoid(z):
4242# calculate the cross-entropy error
4343def cross_entropy (T , Y ):
4444 E = 0
45- for i in xrange (N ):
45+ for i in xrange (len ( T ) ):
4646 if T [i ] == 1 :
4747 E -= np .log (Y [i ])
4848 else :
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def sigmoid(z):
4242# calculate the cross-entropy error
4343def cross_entropy (T , Y ):
4444 E = 0
45- for i in xrange (N ):
45+ for i in xrange (len ( T ) ):
4646 if T [i ] == 1 :
4747 E -= np .log (Y [i ])
4848 else :
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def sigmoid(z):
4242# calculate the cross-entropy error
4343def cross_entropy (T , Y ):
4444 E = 0
45- for i in xrange (N ):
45+ for i in xrange (len ( T ) ):
4646 if T [i ] == 1 :
4747 E -= np .log (Y [i ])
4848 else :
You can’t perform that action at this time.
0 commit comments