Performance, Pytorch, Deep Learning, Artificial Intelligence, Tensorboard.
__init__(self, ignore_val=-1, num_classes=10): super().__init__() self.ignore_val = ignore_val self.num_classes = num_classes self.loss = torch.nn.CrossEntropyLoss() def cross_entropy(self, pred: Tensor, target: Tensor) -> Tensor: # create a boolean mask of valid labels with