i\'ve tried to use the codes given from Keras before they\'re removed. Here\'s the code :
def precision(y_true, y_pred):
true_positives = K.sum(K.round(K
I also suggest this work-around
model.fit(nb_epoch=1, ...) inside a for loop taking advantage of the precision/recall metrics outputted after every epochSomething like this:
for mini_batch in range(epochs):
model_hist = model.fit(X_train, Y_train, batch_size=batch_size, epochs=1,
verbose=2, validation_data=(X_val, Y_val))
precision = model_hist.history['val_precision'][0]
recall = model_hist.history['val_recall'][0]
f_score = (2.0 * precision * recall) / (precision + recall)
print 'F1-SCORE {}'.format(f_score)