We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b88d131 commit 751661aCopy full SHA for 751661a
1 file changed
lab-07-2-learning_rate_and_evaluation.py
@@ -53,3 +53,10 @@
53
plt.imshow(mnist.test.images[r:r + 1].reshape(28,
54
28), cmap='Greys', interpolation='nearest')
55
plt.show()
56
+
57
+ # Test model
58
+ correct_prediction = tf.equal(tf.argmax(hypothesis, 1), tf.argmax(Y, 1))
59
+ # Calculate accuracy
60
+ accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
61
+ print("Accuracy: ", accuracy.eval(session=sess, feed_dict={
62
+ X: mnist.test.images, Y: mnist.test.labels}))
0 commit comments