如果y是one-hot encoding格式,使用sparse_categorical_crossentropy

[1,0,0]
[0,1,0]
[0,0,1]

如果y是整数,非one-hot encoding格式,使用categorical_crossentropy

1
2
3