2020
10-08
10-08
keras用auc做metrics以及早停实例
我就废话不多说了,大家还是直接看代码吧~importtensorflowastffromsklearn.metricsimportroc_auc_scoredefauroc(y_true,y_pred):returntf.py_func(roc_auc_score,(y_true,y_pred),tf.double)#BuildModel...model.compile(loss='categorical_crossentropy',optimizer='adam',metrics=['accuracy',auroc])完整例子:defauc(y_true,y_pred):auc=tf.metrics.auc(y_true,y_pred)[1]K.get_session().run(tf.loc...
继续阅读 >