Skip to content

Commit

Permalink
Use streaming metrics to calculate proper values
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Dec 25, 2016
1 parent 842fbd3 commit c2ba6d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/mnist_full/mnist_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def model(image, number, mode):
predictions = tf.argmax(h, axis=1)
train_op = minimize(loss)
eval_metric_ops = {
"accuracy": tf.reduce_mean(tf.to_float(tf.equal(predictions, number)))
"accuracy": tf.contrib.metrics.streaming_accuracy(predictions,
number)[1],
}

if env("use_model_fn_ops"):
Expand Down
3 changes: 2 additions & 1 deletion examples/mnist_simple/mnist_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def model(image, number):
predictions = tf.argmax(h, axis=1)

return predictions, loss, minimize(loss), {
"accuracy": tf.reduce_mean(tf.to_float(tf.equal(predictions, number)))
"accuracy": tf.contrib.metrics.streaming_accuracy(predictions,
number)[1],
}


Expand Down

0 comments on commit c2ba6d7

Please sign in to comment.