-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Hello,
I tried to use AC or ACE losses instead of CE loss for the binary segmentation. Though I have used a certain network for the CE loss many times, the network does not work for AC/ACE losses.
In the meantime, I used a label array whose shape is equal to the prediction. Also, its channels have zero or one values like the code below.
from aceloss import ACLossV2
criterion = ACLossV2(classes=2)
outputs = model(inputs)
masks2 = torch.zeros_like(outputs)
masks2[:, 0, :, :] = (masks == 0).squeeze(1) # shape: [batch size, channel size, width, height]
masks2[:, 1, :, :] = (masks == 1).squeeze(1)
loss = criterion(outputs, masks2)
The loss value is larger than 1e4, and the output for the prediction looks meaningless. Did I miss something? I didn't change any code for the ACELoss class. Thank you.