Closed stefat77 closed 5 years ago
Hello, I'm trying to use the crf loss in my code, but when I run the training I receive a negative loss value. Here's how I defined the loss:
crf_criterion = DenseCRFLoss(weight=1e-8, sigma_rgb=15, sigma_xy=100, scale_factor=0.5) croppings = Variable(torch.ones(2, ws, ws).float()) crf_loss = crf_criterion(255 * x.cpu(), out.cpu(), croppings.cpu())
"x" is a [batch, 3, height, width] image "out" is the softmax segmentation [batch, 2, height, width] "croppings" is the binary mask
I receive a negative loss value between -0.6 and -0.5. How can I deal with it? Is it normal to have a negative crf loss?
Thank you
I meet the same problem, have you solved it ?
This is normal due to the specific continuous relaxation for the discrete CRF energy. See https://github.com/meng-tang/rloss/issues/3
Hello, I'm trying to use the crf loss in my code, but when I run the training I receive a negative loss value. Here's how I defined the loss:
"x" is a [batch, 3, height, width] image "out" is the softmax segmentation [batch, 2, height, width] "croppings" is the binary mask
I receive a negative loss value between -0.6 and -0.5. How can I deal with it? Is it normal to have a negative crf loss?
Thank you