-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trainers.segmentation JaccardLoss receiving num_classes, should be a List[int]? #1896
Comments
I verified the behavior of JaccardLoss here https://gist.github.com/calebrob6/658edaa59c68f0c0a510f8d9d7a41458. Currently our code will always use the average jaccard over all classes regardless of what We definitely should fix this. @isaaccorley |
I suggest this requires a new arg of |
Have you run into scenarios in which you would want to ignore multiple classes? If not, I think we can just pop ignore_index from the entire class list if it is given. |
I've not really used JaccardLoss, and commonly use nn.CrossEntropyLoss where the Coming back to your question, for multiclass datasets where I might only care about 1 or 2 classes, I can imagine ignoring multiple classes |
+1 for fiddling with Yep, I can imagine a few scenarios too (e.g. dropping loss over noisy classes). I would usually do this by simply remapping all classes I didn't care about to a nodata mask value, then setting ignore_index to that value, but this is more elegant. My concern now would be implementing this functionality for the other loss functions. |
TorchSeg now supports both |
Thanks @isaaccorley For anyone looking, they are on branch https://github.com/isaaccorley/torchseg/blob/losses/ignore-index/torchseg/losses/ |
@robmarkcole it's merged into main now. I'll make another pre-release on pypi today. |
Description
From the trainer:
num_classes
is an int, Yet the docs for JaccardLoss state this is expected to be a list of int, presumably the indices of the output channels to use in the calc. Checking if this is a bugSteps to reproduce
NA
Version
main
The text was updated successfully, but these errors were encountered: