Python Examples of torch.nn.CrossEntropyLoss
www.programcreek.com › torchThe following are 30 code examples for showing how to use torch.nn.CrossEntropyLoss().These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
CrossEntropyLoss - PyTorch - W3cubDocs
docs.w3cub.com › torchCrossEntropyLoss. class torch.nn.CrossEntropyLoss (weight: Optional [torch.Tensor] = None, size_average=None, ignore_index: int = -100, reduce=None, reduction: str = 'mean') [source] This criterion combines nn.LogSoftmax () and nn.NLLLoss () in one single class. It is useful when training a classification problem with C classes.
CrossEntropyLoss — PyTorch 1.10.1 documentation
pytorch.org › torchCrossEntropyLoss¶ class torch.nn. CrossEntropyLoss (weight = None, size_average = None, ignore_index =-100, reduce = None, reduction = 'mean', label_smoothing = 0.0) [source] ¶ This criterion computes the cross entropy loss between input and target. It is useful when training a classification problem with C classes.