how to implement custom metric in keras?

Here I’m answering to OP’s topic question rather than his exact problem. I’m doing this as the question shows up in the top when I google the topic problem. You can implement a custom metric in two ways. As mentioned in Keras docu. import keras.backend as K def mean_pred(y_true, y_pred): return K.mean(y_pred) model.compile(optimizer=”sgd”, loss=”binary_crossentropy”, metrics=[‘accuracy’, … Read more