問題文
A multi-class classifier produces raw scores of shape (batch, num_classes). Which loss function is designed to take those raw scores together with integer class indices as the target?
選択肢
- nn.NLLLoss applied to the raw scores, and the documentation lists it as the objective for multi-class problems.
- nn.MSELoss, because comparing the raw scores with the class indices directly gives a differentiable objective that is standard for classification problems with more than two classes.
- nn.CrossEntropyLoss, which the documentation describes as taking unnormalized logits and class indices.
- nn.BCELoss with the indices as targets.