Replies: 1 comment
-
We would love to have some kind of weighted geo sampler in TorchGeo, and other users have requested this feature to: #757 If you want to try to implement something I would be happy to review the PR. I think you'll find that it's tricky since our R-tree indices don't currently store that kind of information, and it's difficult to make something generic enough for all possible use cases. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any way of handling unbalanced datasets with TorchGeo's current samplers?
The
RandomGeoSampler
is fine for training models on balanced datasets, but in cases where datasets are heavily unbalanced we'd benefit from having strategies such as getting samples of the unbalanced label(s) more often, weighting the unbalanced label(s) more and other techniques.In PyTorch, there is a
WeightedRandomSampler
class that is useful for this, but I don't think that it can be applied directly to TorchGeo datasets, given the difference in how samples are indexed.As an example, think of a binary segmentation task where the label that we want to segment is much rarer than the background.
Beta Was this translation helpful? Give feedback.
All reactions