Comments (5)
OK, I have numba working on feature.py
, similar to how Nathan used it on identification.py
: it speeds up the refine loop. For extra credit, I managed to keep general dimensions, not just 2D.
I have more work to do before I merge this into master, but for this is the speedup so far:
numba-dan branch:
noise-filled dummy image: 1 loops, best of 3: 1.15 s per loop
image of particles: 1 loops, best of 3: 1.61 s per loop
on master:
noise-filled dummy image: 1 loops, best of 3: 1.32 s per loop
image of particles: 1 loops, best of 3: 1.9 s per loop
from trackpy.
Figures above had memorization code removed. The times are better with memoization reinstated, so masks are only generated once.
numba-dan with memoization turned on
1 loops, best of 3: 966 ms per loop
1 loops, best of 3: 1.38 s per loop
from trackpy.
Yes, numba (or cython, etc.) is worth the trouble! :) At least when you're tracking a flowing material made of close-packed particles, which really taxes the subnet code. Switching the subnet code to numba gave me roughly an order of magnitude in speed for my data.
I have battled numba before, so if you are running into problems, I may be able to help. Also, now that you have the numba code running and passing tests, there may be ways to speed it up. As in Cython, it's possible for the code to silently drop back into the Python object model, which means a huge penalty.
I have re-forked the master branch of this repo and will probably add the numba subnet code soon. I don't mean to be impatient --- I just have to add a feature to the linker for my research, and I thought I'd try to quit my old numba branch, which means that I need comparable performance from the new one soon.
I'm so glad that refine
can work with numba! Thanks!
from trackpy.
Great! Once I have something that I'm sure is working, I'll ask for your help. Maybe later today if things go well.
Don't worry about seeming impatient -- I was worried about seeming that way myself. I'd like to have something stable to work on soon. I think what remains is:
- Develop PIMS to the point where the API is stable so that the tutorials for trackpy will be stable too. As you can see, Tom has been hard at work nearly rewriting the whole thing, making it much better.
- Merge in my numba refine branch.
- Merge in your numba subnet branch, and set up the existing unit tests to run on it.
- Test things on real data for a few days.
- Update README/docs/tutorials at least to the point that there is no wrong information.
Anything else on our collective wish list before declare victory on v0.2 and start using it full time?
from trackpy.
We have our numba subnet. #44 paves the way for a drop-in replacement or 2D special case for refine, whether it numba, cython, or C. Since Nathan has indicated that his needs are met in runtrackpy, I will close this issue.
from trackpy.
Related Issues (20)
- object has no attribute 'long_name' (when inspecting 'frame') HOT 2
- tp.emsd TypeError: mean() got an unexpected keyword argument 'level' HOT 7
- Working on a napari-trackpy plugin HOT 1
- TST: Weird dtype switching on Windows HOT 2
- link_df_iter giving TypeError when using pd.concat?
- level keyword argument was removed in pandas>2.0 HOT 1
- Release v0.6.2 HOT 5
- Tutorial shows problem using latest pandas HOT 2
- Linking using multiple HDF5 files. HOT 1
- Use pims.as_grey instead of image[:, :, 1] in walkthrough tutorial.
- Old Python version in installation instructions
- TST: Need to replace a GitHub action
- tp.batch does not perform batch correctly (all frames output as 0) HOT 3
- Error in trackpy.emsd() function: TypeError: mean() got an unexpected keyword argument 'level' HOT 5
- `plot_traj3d` throws error
- Locate only within specific ROI HOT 2
- [Question] methods for initial estimation of `minmass` HOT 1
- [Enhancement] Allowing possibility to convert raw image to `uint16`
- [Question] How to add optional arguments in after_locate function in tp.batch HOT 1
- Release v0.6.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trackpy.