ilastik / hytra

Python module for multi HYpotheses TRAcking
https://github.com/ilastik/hytra
MIT License
2 stars 7 forks source link

Cython experiment to speed up GMM fitting #9

Closed chaubold closed 7 months ago

chaubold commented 7 years ago

This should be used with caution, but can give some speedup, e.g. for resolving ~600 objects in 2D:

with_cython_run1 -> 7.611491999999998s
with_cython_run2 -> 7.44231s
no_cython_run1 -> 7.9705189999999995s
no_cython_run2 -> 8.174182s
chaubold commented 7 years ago

Okay, some more testing reveals that these timing results are not stable. So let's just discard this experiment.

I'd say either we set up a proper C++ module for the GMM fit, or we just leave it as is.

Fitting gmm to a 2-merger with coords of shape (915, 3):

cython
-------
GMM fitting took 0.0182185769081 secs on average in 100 runs
GMM fitting took 0.0176032233238 secs on average in 100 runs

sklearn
-------
GMM fitting took 0.0129393935204 secs on average in 100 runs
GMM fitting took 0.0162936210632 secs on average in 100 runs

@JaimeIvanCervantes: On another note: for testing I used one real world merger from a 2D dataset as we see it in ilastik. Even though it is 2D we are still passing in 3 coordinates per pixel. Using only 2 might give us a little performance.

k-dominik commented 7 months ago

I'll say in the end we left it as is :)