I am using doing binary segmentation using Signet, IoU loss. the problem is Precision, recall and f1 score values become exp. kindly guide me if there is an issue with my loss function or there is any other issue.i have pasted the loss  code below
Thank you

class IoULoss(nn.Module):
    def __init__(self, weight=None, size_average=True):
        super(IoULoss, self).__init__()

    def forward(self, inputs, targets, smooth=1):

        inputs = inputs.view(-1)
        targets = targets.view(-1)

        intersection = (inputs * targets).sum()
        total = (inputs + targets).sum()
        union = total - intersection 
        
        IoU = (intersection + smooth)/(union + smooth)
                
        return 1 - IoU