Skip to content

Commit

Permalink
update theano TUT
Browse files Browse the repository at this point in the history
  • Loading branch information
Mofan Zhou committed Jul 30, 2016
1 parent 1a0ce88 commit e16dcf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion theanoTUT/theano11_classification_nn/full_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def compute_accuracy(y_target, y_predict):


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

0 comments on commit e16dcf9

Please sign in to comment.