ptrblck:

If your target is a probability between 0 and 1, you could directly use it in nn.BCEWithlogitsLoss .


Thank you very much for the suggestion. I am using  a customized loss function consisting of the combination of cross_entropy loss and dice loss.



 ptrblck:

If your model outputs are logits, you could use a threshold of 0.0 .


In this case, how should the threshold be applied? Please, could you provide a sample code?