# what is the difference between binary cross entropy and categorical cross entropy? [duplicate]

So, I made a bidirectional LSTM model for sentiment classification. Model's job was to predict ratings of movies(1-5 stars) based on the movie review.

While training the model I first used categorical cross entropy loss function. I trained the model for 10+ hours on CPU for about 45 epochs. While training every epoch showed model accuracy to be 0.5098(same for every epoch).

Then I changed the loss function to binary cross entropy and it seemed to be work fine while training. So, I want to know what exactly is the difference between these two?

## marked as duplicate by Sycorax, Michael Chernick, kjetil b halvorsen, gung♦Jul 25 '18 at 14:19

• Binary cross entropy is for binary classification but categorical cross entropy is for multi class classification , but both works for binary classification , for categorical cross entropy you need to change data to to_categorical . – ᴀʀᴍᴀɴ Jul 17 '18 at 11:06