BCEWithLogitsLoss — PyTorch 1.10.1 documentation
pytorch.org › docs › stableBCEWithLogitsLoss (weight = None, size_average = None, reduce = None, reduction = 'mean', pos_weight = None) [source] ¶ This loss combines a Sigmoid layer and the BCELoss in one single class. This version is more numerically stable than using a plain Sigmoid followed by a BCELoss as, by combining the operations into one layer, we take advantage of the log-sum-exp trick for numerical stability.
torch.nn.functional.binary_cross_entropy_with_logits ...
pytorch.org › docs › stabletorch.nn.functional. binary_cross_entropy_with_logits (input, target, weight = None, size_average = None, reduce = None, reduction = 'mean', pos_weight = None) [source] ¶ Function that measures Binary Cross Entropy between target and input logits. See BCEWithLogitsLoss for details. Parameters. input – Tensor of arbitrary shape as unnormalized scores (often referred to as logits).