フリー問題

PyTorch Certified Associate のフリー問題 11 / 20 問目

問題文

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?

選択肢

  1. nn.NLLLoss applied to the raw scores, and the documentation lists it as the objective for multi-class problems.
  2. 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.
  3. nn.CrossEntropyLoss, which the documentation describes as taking unnormalized logits and class indices.
  4. nn.BCELoss with the indices as targets.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。