pytorch_sparse icon indicating copy to clipboard operation
pytorch_sparse copied to clipboard

Fix issue with sampling without replacement

Open aristizabal95 opened this issue 1 year ago • 3 comments
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.

aristizabal95 avatar Oct 01 '24 22:10 aristizabal95