Reputation: 2358
I have downloaded an example code of MLP and trying to understand how it works. I came accross this line where it calculates the accuracy of test datasets.
accuracy = sess.run(accuracy, feed_dict={X: data_test, y: labels_test, dropout_keep_prob:1.})
Now, I want to get the predicted labels as well. How can I get the predicted labels?
Upvotes: 0
Views: 920
Reputation: 11968
You need to get the prediction tensor. If you have the code it's the one you compare to y
to compute the accuracy. Say it's called prediction
, then you can write:
accuracy, prediction = sess.run([accuracy, prediction], feed_dict={X: data_set, y:labels_test, ...})
Upvotes: 2