Keras categorical_accuracy指标的输出是什么? [英] Whats the output for Keras categorical_accuracy metrics?

查看:209
本文介绍了Keras categorical_accuracy指标的输出是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到对度量标准输出的正确描述.

I cant find proper description of metrics outputs.

例如,如果我使用

model.compile(loss ='categorical_crossentropy',optimizer ='adam',metrics = ['accuracy'])

然后我得到损失和准确性 tr_loss,tr_acc = model.train_on_batch(X,Y)

then I get loss and accuracy tr_loss, tr_acc = model.train_on_batch(X, Y)

如果我使用 metrics = ['categorical_accuracy'] 进行编译,那么我也会得到2个数字,

if I compile with metrics=['categorical_accuracy'] then I get 2 numbers as well,

但是它们是什么?

我这样做: print(model.metrics_names)并得到: ['loss','categorical_accuracy']

推荐答案

accuracy 度量标准实际上是一个占位符,而keras为您在 binary_accuracy 之间选择合适的精度度量标准如果您使用 binary_crossentropy 损失,而 categorical_accuracy 如果您使用 categorical_crossentropy 损失.

The accuracy metric is actually a placeholder and keras chooses the appropriate accuracy metric for you, between binary_accuracy if you use binary_crossentropy loss, and categorical_accuracy if you use categorical_crossentropy loss.

因此,在这种特定情况下,两个指标( accuracy categorical_accuracy )实际上是相同的,并且 model.evaluate 回波损耗和准确性

So in this specific case, both metrics (accuracy and categorical_accuracy) are literally the same, and model.evaluate return loss and accuracy.

这篇关于Keras categorical_accuracy指标的输出是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆