Hello Guys, I have fixed the negative values issues by Normalizing my data. Now I’m facing another issue which is the accuracy is very high, I think there is something wrong with my accuracy code. Can you please look at my code and let me know what is going on. Thank you.
for epoch in range(num_epochs):
    running_loss = 0
    total_train = 0
    correct_train = 0
    loss_values = []
    running_loss = 0.0

    for i, data in enumerate(train_loader, 0):

        # get the inputs
        t_image, mask = gen.__getitem__(0)
        t_image, mask = torch.Tensor(t_image),  torch.Tensor(mask)
        t_image = t_image.view([t_image.shape[0], 1 , t_image.shape[1], t_image.shape[2]])
        mask = mask.view([mask.shape[0], 1 , mask.shape[1], mask.shape[2]])
        t_image, mask = Variable(t_image.float()), Variable(mask.float()) 


        optimizer.zero_grad()
        output = model(t_image) # forward
        outputs = torch.sigmoid(output)
        loss = criterion(outputs, mask) 
        loss.backward() # back propagation
        optimizer.step() # update gradients
        running_loss += loss.item()
        mask = torch.tensor(mask, dtype=torch.long, device=device)
        
        running_loss =+ loss.item() * t_image.size(0)

accuracy
        _, predicted = torch.max(outputs.data, 1)
        total_train +=  mask.nelement() #mask.size(0)
        correct_train += predicted.eq(mask.data).sum().item()
        train_accuracy = 100 * correct_train / total_train
        #avg_accuracy += train_accuracy 
         
   
        print("Epoch {}/{}, Train Loss: {:.3f}, Train Accuracy: {:.3f}".format(epoch+1, num_epochs, loss.item(), train_accuracy))   

Epoch 1/1, Train Loss: 0.718, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.893, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.633, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.376, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.275, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.201, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.172, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.170, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.144, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.165, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.154, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.131, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.152, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.217, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.178, Train Accuracy: 606.793
Epoch 1/1, Train Loss: 0.174, Train Accuracy: 606.793