When I look at some of the metrics in metrics.py, two of the metrics I see are:
def categorical_accuracy(y_true, y_pred):
return K.mean(K.equal(K.argmax(y_true, axis=-1),
K.argmax(y_pred, axis=-1)))
def sparse_categorical_accuracy(y_true, y_pred):
return K.mean(K.equal(K.max(y_true, axis=-1),
K.cast(K.argmax(y_pred, axis=-1), K.floatx())))
Am I correct in believing that both of these metrics are designed for a 1-hot encoding, but that the sparse_categorical_accuracy casts outputs to type float, whereas the categorical_accuracy does not?