Skip to content

Commit e16dcf9

Browse files
author
Mofan Zhou
committed
update theano TUT
1 parent 1a0ce88 commit e16dcf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

theanoTUT/theano11_classification_nn/full_code.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def compute_accuracy(y_target, y_predict):
3434

3535

3636
# Construct Theano expression graph
37-
p_1 = 1 / (1 + T.exp(-T.dot(x, w) - b)) # Logistic Probability that target = 1 (activation function)
37+
p_1 = T.nnet.sigmoid(T.dot(x, w) + b) # Logistic Probability that target = 1 (activation function)
3838
prediction = p_1 > 0.5 # The prediction thresholded
3939
xent = -y * T.log(p_1) - (1-y) * T.log(1-p_1) # Cross-entropy loss function
4040
cost = xent.mean() + 0.01 * (w ** 2).sum()# The cost to minimize (l2 regularization)

0 commit comments

Comments
 (0)