Skip to content

Commit 742675d

Browse files
committed
1 parent 844bbfc commit 742675d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/2 - Basic Classifiers/logistic_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
activation = tf.nn.softmax(tf.matmul(x, W) + b) # Softmax
3333

3434
# Minimize error using cross entropy
35-
cost = -tf.reduce_sum(y*tf.log(activation)) # Cross entropy
35+
cost = tf.reduce_mean(-tf.reduce_sum(y*tf.log(activation), reduction_indices=1)) # Cross entropy
3636
optimizer = tf.train.GradientDescentOptimizer(learning_rate).minimize(cost) # Gradient Descent
3737

3838
# Initializing the variables

0 commit comments

Comments
 (0)