-
Notifications
You must be signed in to change notification settings - Fork 15
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
Performance problem calling np.where #67
Comments
I will look into this. |
Please update to the latest version 9.86.3 for a version of np.where with much higher performance. To get the big performance, use the same data type for both x and y choices. Thank you. |
Ah awesome thanks! Works great now. |
I missed the np.isfinite mention before. I improved the performance of that API in 9.86.4 if you want to try it. Thank you. |
Awesome, thanks. Will try it out tomorrow and let you know. |
Wow. Thanks @KevinBaselinesw , isfinite() is way faster now. |
Sorry to be a pain @KevinBaselinesw , but I've got some weird behavior in np.where() that I can't figure out. (just some background - I'm working with a 3 dimensional array that contains data that will eventually be rgb data for an image) Consider this python code (don't worry to much about the data, it's the shapes that are important)
In this case filter has a shape of (496, 682) and sampleData has a shape of (3, 496, 682). 'filteredData' has a shape of (3, 496, 682) - so it keeps the shape of the x and y arguments. If I do something similar using the .net version then filteredData has a shape of (496, 682) - the shape of the filter, not sampleData. That's not necessarily a bug, it's just different behavior. Here's some sample code:
Following that I tried to replicate the behavior of numpy by treating each dimension as a separate array i.e. treating each 496*682 layer as it's own ndarray and then performing a np.where() on that. So I ended up with 3 np.where() calls, but each call returned the same data irrespective of the input data (it seemed like it still operating on the full original data). Here's some simplified code:
Hope that all makes sense. Cheers |
I am working on it. Probably finish this tonight. |
0.9.86.6 will fix all of your reported bugs (hopefully :) |
Thanks, appreciated. Looks good! 😄 |
Hi
I've hit what seems to be a bit of a performance problem with the np.where(). Consider the following code:
I thought I might be experiencing something similar to #56 , but all 3 uses of where() above take more than a minute to execute (I've also seen something similar with isfinite() previously).
Am I doing something wrong, or is this expected behavior?
Thanks
Greg
The text was updated successfully, but these errors were encountered: