Why does categorical_crossentropy work in when input is not 1-hot encoded? I'm going through lessons on the REINFORCE algorithm to solve Cartpole/Pong/etc (using AIGym) and every one uses categorical_crossentropy as the loss function.
What's confusing me is that categorical_crossentropy expects a 1-hot encoded setup as its true parameter. The states being passed in are not 1-hot encoded, they're just the numerical representation of the state of the universe at that moment. Why does this work?
The algorithm converts your categorical labels into one hot encode before calculating loss. So you don't have to carry the burden.