categorical_crossentropy VS sparse_categorical_crossentropy

  • If the targets are one-hot encoded, use categorical_crossentropy
    • Examoles of one-hot encodings:
      • [1, 0, 0]
      • [0, 1, 0]
      • [0, 0, 1]
  • If the targets are integers, use sparse_categorical_crossentropy
    • Examples of integer encodings
      • 1
      • 2
      • 3
posted @ 2019-10-07 08:21  larkii  阅读(105)  评论(0编辑  收藏  举报