Performance, Pytorch, Deep Learning, Artificial Intelligence, Tensorboard.
elements in target with torch.profiler.record_function('unique'): unique = torch.unique(target) # check if the number of unique items pass the threshold with torch.profiler.record_function('numel'): ignore_loss = torch.numel(unique) < 2 # calculate the cross-entropy loss loss =