CrossEntropyLoss — PyTorch 1.10.1 documentation
pytorch.org › torchThis criterion computes the cross entropy loss between input and target. It is useful when training a classification problem with C classes. If provided, the optional argument weight should be a 1D Tensor assigning weight to each of the classes. This is particularly useful when you have an unbalanced training set.