Coder Social home page Coder Social logo

Numba decorators about pycpd HOT 5 CLOSED

siavashk avatar siavashk commented on August 22, 2024
Numba decorators

from pycpd.

Comments (5)

agporto avatar agporto commented on August 22, 2024 1

@siavashk @gattia thank you both very much for the feedback. It seems that this might be an experiment worth doing. I will fork the repo and progressively work on it over the coming months. At first glance, it seems (from the numba docs) that it would be an easy conversion. I will keep you both posted. Thanks again.

from pycpd.

gattia avatar gattia commented on August 22, 2024

I implemented some parts of the pycpd algorithm in cython to speed up those parts which are iterative and published it as cycpd: https://github.com/gattia/cycpd

I also added some of the other original methods from the CPD paper (low rank non-rigid/deformable transform) into cycpd. I have since incorporated them back into pycpd as well - though only on development branch for now. See pull request/merge here: #37.

From what I played around with it seemed the next thing to do to speed things up was to add the Fast Gauss Transform (FGT) from the original CPD paper. I have written about this on the readme/intro page of the cycpd repo. I haven't looked into it much, but it seems like FGT should speed up all of the methods (rigid, affine, deformable).

from pycpd.

agporto avatar agporto commented on August 22, 2024

Hi Anthony. Thanks for the link. It looks awesome. I will definitely try it out and compare. Just out of curiosity, have you tried numba decorators out? If so, how do they compare with your cython compilation?

from pycpd.

gattia avatar gattia commented on August 22, 2024

Arthur, I dont have any experience with Numba. Though, it could be interesting due to the supposedly easy leveraging of GPUs. The below blog makes a few comparisons between Cython/Numba. I used the Cython version as a chance to learn some more Cython code as well as to speed up the python (cython) cpd version.

https://lewiscoleblog.com/cython-numba

Sounds like testing Numba is worth a try. The only thing I've read is that Numba might be more finicky to distribute than Cython.... but that might be an old problem that is solved now.

As a different note, @siavashk originally intended this to be a numpy version for teaching purposes. Though, Numba doesn't seem like it will change the code much, so maybe he's open to adding Numba, or maybe a Numba branch to keep things a little separate. Alternatively, you could create a new repo based that builds off of pycpd like I did with cycpd.

from pycpd.

siavashk avatar siavashk commented on August 22, 2024

Sorry I am kind of swamped with work. I haven't tried numba but I have heard good things about it. If you fork the project and make changes, I would be happy to help you. It would be a learning experience for me as well. I believe that the code would still be numpy readable even with numba, so people can still use it for educational purposes.

It would be really nice if you could make an example with numba decorators and show that it is faster. Something like run 1000 registrations, one with numba and one without numba and see if it is faster. This would make a good case for the integration.

from pycpd.

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.