NLLLoss()的参数是经过logsoftmax加工的,而CrossEntropyLoss的是原始输出数据. target = torch.tensor([1, 2]). entropy_out = F.cross_entropy(data, target).
確定! 回上一頁