aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/keras/metrics.py
diff options
context:
space:
mode:
authorGravatar Martin Wicke <wicke@google.com>2018-09-14 10:26:11 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-14 10:29:28 -0700
commitc7458c97a5f752a2ae79da4cba04ced0dbcb76df (patch)
tree21c2b304c5c2bd54411e506adf5a61e4d2430169 /tensorflow/python/keras/metrics.py
parent82e4edc50fb146dbf006cd81aaac6d01f40533a6 (diff)
Export tf.keras.sparse_categorical_accuracy. Copied from PR #21790.
closes #21790, fixes #21735 PiperOrigin-RevId: 213003724
Diffstat (limited to 'tensorflow/python/keras/metrics.py')
-rw-r--r--tensorflow/python/keras/metrics.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/python/keras/metrics.py b/tensorflow/python/keras/metrics.py
index 473d8cd95b..fd3c39cf2e 100644
--- a/tensorflow/python/keras/metrics.py
+++ b/tensorflow/python/keras/metrics.py
@@ -615,6 +615,7 @@ def categorical_accuracy(y_true, y_pred):
K.floatx())
+@tf_export('keras.metrics.sparse_categorical_accuracy')
def sparse_categorical_accuracy(y_true, y_pred):
y_true = math_ops.reduce_max(y_true, axis=-1)
y_pred = math_ops.argmax(y_pred, axis=-1)