这是我的计算准确性和auc的函数:
def calc_metrics(is_test):
model_name = 'Dataset/test' if is_test else 'Dataset/train'
model = ModelNet10(model_name)
batch_size = 50
epoch_lim = int(model.dataset_len / batch_size) + 1
acc = 0
auc_var = tf.contrib.metrics.streaming_auc(out, lbl)
sess.run(tf.local_variables_initializer())
for i in range(epoch_lim):
images, labels = model.next_batch(batch_size)
feed_dict = {x: images, y_: labels, keep_prob_drop1: 1.0, keep_prob_drop2: 1.0}
auc, cur_acc = sess.run([auc_var, accuracy], feed_dict=feed_dict)
acc += cur_acc / epoch_lim
return acc, auc[0]
这里通过记录此函数的输出产生结果:
Test accuracy/Auc = 0.8463888929949868/0.9650000333786011
Iter 2700, Minibatch Loss 2555.335205078125, Batch Accuracy 0.800000011920929
Test accuracy/Auc = 0.8077777789698706/0.9772918820381165
Iter 2800, Minibatch Loss 1188.008056640625, Batch Accuracy 0.8999999761581421
Test accuracy/Auc = 0.8074999981456332/0.968892514705658
Iter 2900, Minibatch Loss 426.5060119628906, Batch Accuracy 0.8999999761581421
Test accuracy/Auc = 0.7513888908757105/0.9779732823371887
Iter 3000, Minibatch Loss 5560.1845703125, Batch Accuracy 0.699999988079071
Test accuracy/Auc = 0.8733333349227907/0.9733150005340576
Iter 3100, Minibatch Loss 3904.02490234375, Batch Accuracy 0.8999999761581421
Auc非常高 - 太高了 - 在我看来。我已经检查了tensorflow文档数百次,但可以理解可能出错的地方。
有人可以帮我找一个错误吗?