A question that came up when tried working with a pretrained unet_learner, with binary segmentation data (gray scale image + binary mask).
The predictions I get per pixel are all well situated between 0 and 1. But when I replace the “learn.loss_func” with some custom function, I get values outside of 0-1 (typically -100 to 100). Both cases occur even before performing any training (leaving that model strictly pre-trained).
How is it that simply modifying the loss function directly changes the predictions, without me performing any training?
To be clear, all I do is:
- learn = unet_learner(data, models.resnet34, metrics=[dice])
- optionally redefine the learn.loss_func
- preds, ys = learn.get_preds(DatasetType.Train)
- check out preds.max(), preds.min()
Thanks in advance!