3

I cant find proper description of metrics outputs.

For example if I use

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

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

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

but what are they ?

EDIT: I did this: print(model.metrics_names) and got: ['loss', 'categorical_accuracy']

Boppity Bop
  • 9,613
  • 13
  • 72
  • 151
  • Possible duplicate of [What values are returned from model.evaluate() in Keras?](https://stackoverflow.com/questions/51299836/what-values-are-returned-from-model-evaluate-in-keras) – today May 19 '19 at 14:47

2 Answers2

4

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.

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

Dr. Snoopy
  • 55,122
  • 7
  • 121
  • 140
2

Could you please post the two numbers you mentioned? I guess they are loss (categorical_crossentropy in your case) and metrics you added. (accuracy or categorical_accuracy as configured in your case).

Eric Yu
  • 441
  • 3
  • 8