Why don't you apply a softmax function before the final prediction?
zwx8981 opened this issue · comments
HI, thank you for great work, I have a little question. As a classification task,we usually apply a softmax function to convert the output of a model into a probabilistic vector, each entry of which represents the probability of the input that belonging to the corresponding category. However, it seems that in your code the output of the Mutan model (the output of the second multimodel fusion followed by only a linear transformation without a softmax) is directly fed into the loss function. Is there any special consideration?
Line 152 in be1b611
@zwx8981 Here we use nn.CrossEntropyLoss
which combines nn.LogSoftmax
and nn.NLLLoss
. Thus, we don't need to add a softmax. It is already included.
@Cadene Thank you!