davide
davide

Reputation: 101

Keras categorical-crossentropy vs binary-crossentropy

i've searched the difference between categorical cross-entropy and binary cross-entropy in keras (as loss functions), but i can't find a complete and convincing answer. In a multi label classification problem, which one should be used? What are the formulas for each one?

thanks in advance

Upvotes: 1

Views: 944

Answers (1)

Daniel Möller
Daniel Möller

Reputation: 86600

Do you want a multilabel with only one correct label or with many correct labels?

  • Use 'categorical_crossentropy' for a single correct label. Good combined with 'softmax', for instance
  • Use 'binary_crossentropy' for many correct labels (independent labels). Good combined with 'sigmoid'.

Upvotes: 2

Related Questions