The Python Oracle

computation of test data in tensorflow tutorial

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Techno Bleepage Open

--

Chapters
00:00 Computation Of Test Data In Tensorflow Tutorial
01:04 Accepted Answer Score 3
01:38 Answer 2 Score 2
02:08 Thank you

--

Full question
https://stackoverflow.com/questions/3767...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #machinelearning #tensorflow #deeplearning

#avk47



ACCEPTED ANSWER

Score 3


accuracy depends on correct_prediction which depends on y.

So when you call sess.run(accuracy, feed_dict={x: mnist.test.images, y_: mnist.test.labels}), y is computed before accuracy is computed. All this happen inside the TensorFlow graph.


The TensorFlow graph is the same for train and test. The only difference is the data you feed to the placeholders x and y_.




ANSWER 2

Score 2


y is computed here:

y = tf.nn.softmax(tf.matmul(x, W) + b) # Line 7

specifically what you are looking for is with in that line:

tf.matmul(x, W) + b

the output of which is put through the softmax function to identify the class.

This is computed in each of the 1000 passes through the graph, each time the variables W, and b are updated by GradientDescent and y is computed and compared against y_ to determine the loss.