MCPcopy Create free account
hub / github.com/MorvanZhou/tutorials / compute_accuracy

Function compute_accuracy

tensorflowTUT/tf16_classification/full_code.py:26–32  ·  view source on GitHub ↗
(v_xs, v_ys)

Source from the content-addressed store, hash-verified

24 return outputs
25
26def compute_accuracy(v_xs, v_ys):
27 global prediction
28 y_pre = sess.run(prediction, feed_dict={xs: v_xs})
29 correct_prediction = tf.equal(tf.argmax(y_pre,1), tf.argmax(v_ys,1))
30 accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
31 result = sess.run(accuracy, feed_dict={xs: v_xs, ys: v_ys})
32 return result
33
34# define placeholder for inputs to network
35xs = tf.placeholder(tf.float32, [None, 784]) # 28x28

Callers 1

full_code.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected