ptrblck:

For a multi-label classification/segmentation you cannot use torch.argmax, but could use a threshold to get the predictions for each sample/pixel.


When using the BCEWithLogitsLoss I don’t torch.argmax since it takes directly the stacked one-hot encoded targets with 1 representing the presence and 0 representing the absence of each class label in the stack.
I’m a bit confused as regard thresholding the logits (the network final layer’s outputs with activation function) to get the predictions, are the predictions (either torch.softmax(logits) >> 0.5 or logits >= .5) not meant to be passed the evaluation metric e.g dice_metric(predictions, stacked_one-hot_encoded_targets) and the logits passed to the loss function e.g BCEWithLogitsLoss(logits, stacked_one-hot_encoded_targets)?