polsys / ennemi

Easy Nearest Neighbor Estimation of Mutual Information
https://polsys.github.io/ennemi/
MIT License
35 stars 12 forks source link

Implement initial support for Numba #39

Closed polsys closed 4 years ago

polsys commented 4 years ago

Part of #25 meta-issue.

I want to trial Numba in production, and hence would like to include it in Alpha 2. The library seems to be not complete/stable enough for the conditional MI code path, but the unconditional MI path works and has significant performance benefits.

polsys commented 4 years ago

Pushed the initial-numba branch with the basic implementation in 129f2de. Still missing: making the integration conditional, documentation, CI.

I still hit several issues with the package:

I am not confident enough in Numba to include the support in 1.0. I think the idea is great, but the implementation is still too unstable. I will be happy to consider it for future releases.

Hence, this issue is now blocked on #40.

polsys commented 4 years ago

Tried another approach based on the above comment; pushed as the basic-numba branch 34a04ea. Now I clearly separated a Numba implementation and "pure Python" implementation. I also took scipy.spatial.cKDTree into use in the latter. Good news is that I got the Numba implementation working pretty well, and it even outperforms the cKDTree approach in some cases. However:

Numba is very promising, but I think it's better not to depend on an alpha-quality package. The maintenance cost would probably become too high. Closing this as the result.