MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / accuracy

Function accuracy

tensorflow/python/keras/metrics.py:2747–2754  ·  view source on GitHub ↗
(y_true, y_pred)

Source from the content-addressed store, hash-verified

2745
2746
2747def accuracy(y_true, y_pred):
2748 [y_pred, y_true], _ = \
2749 metrics_utils.ragged_assert_compatible_and_get_flat_values(
2750 [y_pred, y_true])
2751 y_pred.shape.assert_is_compatible_with(y_true.shape)
2752 if y_true.dtype != y_pred.dtype:
2753 y_pred = math_ops.cast(y_pred, y_true.dtype)
2754 return math_ops.cast(math_ops.equal(y_true, y_pred), K.floatx())
2755
2756
2757@keras_export('keras.metrics.binary_accuracy')

Callers 1

testFunction · 0.50

Calls 3

equalMethod · 0.80
castMethod · 0.45

Tested by

no test coverage detected