So I am new to Tensorflow, I am trying to understand exactly when to use feed_dict and when it is unnecessary.
However, I am confused by how the feed_dict works.
For example: Will 1 be the same as 2 and 3?
1. accuracy, cost = sess.run([accuracy, cost], feed_dict = {X:X_batch, Y:Y_batch})
2. accuracy = sess.run(accuracy, feed_dict = {X:X_batch, Y: Y_batch})
cost = sess.run(cost, feed_dict = {X:X_batch, Y:Y_batch})
3. accuracy = sess.run(accuracy, feed_dict = {X:X_batch, Y:Y_batch})
cost = sess.run(cost)
I don't know that if tensorflow receives the same feed_dict in cost and in tensorflow graph computing accuracy already computes cost, do it go over the neural net again to evaluate the value, or it will return the value computed without going through the net again?
Also, since cost was already computed in the graph, if I want to retrieve the latest cost computed, Can I just do it in the manner as 3 does?
Also, from Hvass-Labs/TensorFlow-Tutorials/TensorFlow Tutorial #02 Convolutional Neural Network,
in function plot_conv_weights(weights, input_channel=0)
weights = sess.run(conv_weigh)
Since training weights require we fill the placeholder X and Y with values, but here I saw no feed_dict.
So how exactly feed_dict works?
ps: So I have asked this question in tensorflow github but they closed my question, and show me how tf.Session().run() works.
From what I understand from the documents, tf.Operation if fetched will return None. And tf.Operation are node in the tensorflow graph that does computations for two tensor.
However, I don't think this document is related to my questions...