March 2018
Intermediate to advanced
272 pages
7h 53m
English
In addition to a loss function, Keras lets us also use metrics to help judge the performance of a model. While minimizing loss is good, it's not especially obvious how we expect the model to perform given some loss function. Metrics aren't used in training the model, they're just there to help us understand the current state.
While loss might not mean much to us, accuracy does. We humans understand accuracy fairly well.
Keras defines binary accuracy as follows:
def binary_accuracy(y_true, y_pred): return K.mean(K.equal(y_true, K.round(y_pred)), axis=-1)
This is really just a clever way to simply divide the number of correct answers by the total answers, as we've likely been doing since our very early ...