📜  没有 tf.metrics.auc 的 keras auc - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:37.314000             🧑  作者: Mango

代码示例1
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])