-
Notifications
You must be signed in to change notification settings - Fork 383
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
RandomGeoSampler: several bug fixes #477
Conversation
# Choose a random tile | ||
hit = random.choice(self.hits) | ||
# Choose a random tile, weighted by area | ||
idx = torch.multinomial(self.areas, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this defaults to sampling without replacement -- is that the intention here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only sample a single idx at a time so replacement wouldn't affect anything.
* RandomGeoSampler: prevent area bias * Use builtin PyTorch random Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
* RandomGeoSampler: prevent area bias * Use builtin PyTorch random Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
This PR includes the following fixes:
size=0
queries to handle point datasize=(height, width)
queries for entire tile at a timeThe first requires #375 so has to be in 0.3.0. The rest could theoretically be backported to 0.2.2 but I'm not really planning on a 0.2.2 release at the moment.