How can I change the dimension of the predictions/labels of my model to be adequate?


I’m having trouble with wrong dimensions when comparing my NN forward predictions with the labels though and would really appreciate if someone could hint me in the right direction please!

The error stacktrace is at the bottom and the model is named MRModel and results from tag_logits and labels having an inadequately similar dimension (3 vs 1 whereas it should be 3 vs 2 or 2 vs 1). I looked at all my input, dimensions, batch etc. and I simply don’t comprehend on where I could change some things. This is the first model i’m creating with NLP. Would it be appropriate to use something like Tensor.view or where would I change something to make it fit? I tried to use F.maxpool2d(x,2,2) and got an output with (2x0x?) size which was invalid. is that nevertheless the right track?

Here is my kernel:

it seems like I used a Seq2SeqEncoder instead of a Seq2VecEncoder, stupid