Giter VIP home page Giter VIP logo

Comments (5)

danielballan avatar danielballan commented on July 28, 2024

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.

danielballan avatar danielballan commented on July 28, 2024

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.

nkeim avatar nkeim commented on July 28, 2024

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.

danielballan avatar danielballan commented on July 28, 2024

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:

  1. 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.
  2. Merge in my numba refine branch.
  3. Merge in your numba subnet branch, and set up the existing unit tests to run on it.
  4. Test things on real data for a few days.
  5. 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.

danielballan avatar danielballan commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.