Skip to main content
deleted 26 characters in body
Source Link
nbro
  • 41.4k
  • 12
  • 114
  • 205

The answer (as detailed quite thoroughly here and here) is that specifying...

model.compile(optimizer = 'rmsprop', loss = 'binary_crossentropy', metrics=['accuracy'])

model.compile(optimizer = 'rmsprop', loss = 'binary_crossentropy', metrics=['accuracy'])

...causes causes keras to guess, incorrectly, that because I am using binary_crossentropybinary_crossentropy for the loss function, that I would want to use binary_accuracybinary_accuracy as the way of reporting the accuracy metrics. Apparently, one should specify that one wants the categorical_accuracycategorical_accuracy metrics if one, as I do, has more than two classes.

The answer (as detailed quite thoroughly here and here) is that specifying...

model.compile(optimizer = 'rmsprop', loss = 'binary_crossentropy', metrics=['accuracy'])

...causes keras to guess, incorrectly, that because I am using binary_crossentropy for the loss function, that I would want to use binary_accuracy as the way of reporting the accuracy metrics. Apparently, one should specify that one wants the categorical_accuracy metrics if one, as I do, has more than two classes.

The answer (as detailed quite thoroughly here and here) is that specifying

model.compile(optimizer = 'rmsprop', loss = 'binary_crossentropy', metrics=['accuracy'])

causes keras to guess, incorrectly, that because I am using binary_crossentropy for the loss function, that I would want to use binary_accuracy as the way of reporting the accuracy metrics. Apparently, one should specify that one wants the categorical_accuracy metrics if one, as I do, has more than two classes.

Source Link

The answer (as detailed quite thoroughly here and here) is that specifying...

model.compile(optimizer = 'rmsprop', loss = 'binary_crossentropy', metrics=['accuracy'])

...causes keras to guess, incorrectly, that because I am using binary_crossentropy for the loss function, that I would want to use binary_accuracy as the way of reporting the accuracy metrics. Apparently, one should specify that one wants the categorical_accuracy metrics if one, as I do, has more than two classes.