Answers for "keras auc without tf.metrics.auc"

1

keras auc without tf.metrics.auc

import tensorflow as tf
from sklearn.metrics import roc_auc_score

def auroc(y_true, y_pred):
    return tf.py_func(roc_auc_score, (y_true, y_pred), tf.double)

# Build Model...

model.compile(loss='categorical_crossentropy', optimizer='adam',metrics=['accuracy', auroc])
Posted by: Guest on July-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language