I'm working on a text-generating RNN. I found out that when calculating cross entropy loss, if the input has a size of[batch_size, vocab_size, seq_len] and the target has a size of[batch_size, seq_len], then the model is not working at all however long I train it.
But, if I resize the input to [batch_size*seq_len, vocab] and the target to a 1D vector, then the model will be working just fine.
So my question is, what is cross entropy loss really doing when handling 3D input? Why the first type of calculating loss won't work in my task?