pytorch_scatter
pytorch_scatter copied to clipboard
scatter_median?
Hi. I need a scatter_median
and am trying to develop based on your wonderful CUDA implementations. However, afaik all scatter methods here use atomic update, while to get median, it needs to gather and sort (or is there any way I'm not aware of?), which is not very straight forward to me how I can utilize your codes. Do you have any suggestion regarding this problem? Thanks alot!
You are right that this is not straightforward to add as a scatter
operation, since each thread will process entries in isolation. This is probably best implemented as a segment_csr
kernel, in which the indices pointing to the same output are ordered, see here.
Thanks for the suggestion. I will check it out.
@justanhduc are you ready with this feature ? Can I try it ? I am in dire need of this feature! Best of luck ! @rusty1s As per now is there any other hack to get scatter_median output, without doing cpp ? I can think of a one but it will require me to convert sparse graph to dense matrix.
This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?
Check out Fast k-Selection Algorithms for Graphics Processing Units TOLU ALABI, JEFFREY D. BLANCHARD, BRADLEY GORDON, and RUSSEL STEINBACH 12acm-alabi.pdf
We also have an implementation of this directly in PyG, see here.