我就废话不多说了,大家还是直接看代码吧~
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])
完整例子:
def a
2021-12-09 20:49:08
40KB
AS
auc
c
1