-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Hello!
Thank you for your work!
I am a little bit confused about CrossEntropyLoss2d class, especially:
targets_m[mask] -= 1
loss_all = self.ce_loss(inputs, targets_m.long())
losses.append(torch.sum(torch.masked_select(loss_all, mask)) / torch.sum(mask.float()))
- Why do you subtract 1 from targets masks?
- Why do you use
torch.masked_select(loss_all, mask))for calculating a loss for a single target? It seems incorrect because in that case we forget about a background.
Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels