pytorch_sparse
pytorch_sparse copied to clipboard
Fix issue with sampling without replacement
trafficstars
Before this fix uniform sampling is not guaranteed, over-representing the first combination of neighbors, and not sampling the last possible combination.
This PR ensures all neighbor combinations are considered during sampling, by extending the range of possible indices to include the last element.
Referencing to the example showcased in #385, using this change the sampling distribution is now:
(0, 1) 0.1707
(0, 2) 0.1643
(0, 3) 0.165
(1, 2) 0.1639
(1, 3) 0.1693
(2, 3) 0.1668
Closes #385.