You mean in the last layer, make the output in shape of [batch_size, nb_classes, num_items]?
That’s possible, let the dense layer to fill dimension of classes. Here in this model, num_classes is about 2000~3000, and the input features of model is just around 100, would that be a problem? Another question is how do I transform the output into same shape of the target, cause the final result need it to be.
Actually the exact value of output is not important in this example. If the target is [0 1 2 3], then output [0 2 5 8] or [3 4 9 21] would be equal to the final result. In this sense, it’s a Learning to Rank problem. I just want to compare nn.CrossEntropyLoss to the other pointwise, pairwise, especially listwise loss functions.