We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a0ce88 commit e16dcf9Copy full SHA for e16dcf9
theanoTUT/theano11_classification_nn/full_code.py
@@ -34,7 +34,7 @@ def compute_accuracy(y_target, y_predict):
34
35
36
# Construct Theano expression graph
37
-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)
38
prediction = p_1 > 0.5 # The prediction thresholded
39
xent = -y * T.log(p_1) - (1-y) * T.log(1-p_1) # Cross-entropy loss function
40
cost = xent.mean() + 0.01 * (w ** 2).sum()# The cost to minimize (l2 regularization)
0 commit comments