-
Notifications
You must be signed in to change notification settings - Fork 39
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
Better resampling strategie #7
Comments
Hello, thanks for great job here. I want to implement systematic resampling and found repo from author of paper. But I'm new to CUDA programming and this code looks too complicated. Do you have any idea whether this code can be simplified during implementation? |
I would love to have systematic resampling in this repo. The code from the repo you linked is highly optimizied and thus kinda hard to understand. Your best bet is probably to stick to a simpler less optimized version like the pseudocode from the paper. Reconstructing the pseudocode from the repo you would have something like this: Increment cuda kernel:...
while ( mask && tid < ( num_particles - l ) ) {
mask = prefix_sum[tid + l] < draw;
if ( mask ) {
idx++;
}
l++;
} Decrement cuda kernel:...
while ( !mask ) {
if ( tid > l ) {
mask = prefix_sum[tid - ( l + 1 )] < draw;
} else {
mask = true;
}
if ( !mask ) {
idx--;
}
l++;
} Hope that helps a bit. EDIT: A naive CUDA implementation can be found in the Appendix A.2 of Nicely19. |
Ok i'll try something simple, and if it works i'll post it here. |
Upd: I'll successfully implement parallel systematic resampling (just copy original code with little fixes).
So, imho for this algo multinomial sampling is the best choice. |
@ShepelIlya I see. Thank you for testing this out. Would you mind sharing the code? |
I have a several bug fixes (a little memory leak, coordinates manipulation, measurement and grid cells with SoA syntax and branch for resampling). Can I only publish all this stuff on my fork and leave merge stuff to you? If so, then I can do it in a couple of days. |
Sure, sounds good. |
Use Systematic Resampling instead of Multinomial.
Parallel implementation: https://ieeexplore.ieee.org/document/8694030
The text was updated successfully, but these errors were encountered: