gudhi-devel icon indicating copy to clipboard operation
gudhi-devel copied to clipboard

Speed of plot_persistence_density

Open mglisse opened this issue 2 years ago • 2 comments

plot_persistence_density is rather slow, because the density estimation takes a lot of time. For a grid 300x300 and 10000 points, it already takes about 10s with scipy, and more if I try to use sklearn, even with a low precision. Since its main purpose is to help visualize diagrams with many points, that's an issue.

  • The default bandwidth seems rather large, which both makes the output too blurry and probably slows down computations.
  • Neither scipy not sklearn offer any option for parallelism :disappointed:
  • When evaluating the KDE on a grid, much faster implementations exist (KDEpy, fastKDE). Similar to numpy.histogram2d + scipy.signal.convolve with a small mask?
  • We are in no way restricted to Gaussian KDE, we could try other density estimators if they are faster.

mglisse avatar Jan 20 '23 21:01 mglisse

See https://github.com/mglisse/TDA-tutorial/blob/density/Tuto-GUDHI-density-plot.ipynb (permalink) for an experiment trying to plot densities.

mglisse avatar Mar 03 '23 10:03 mglisse

https://stackoverflow.com/q/20105364/1918193 contains some good ideas.

mglisse avatar Mar 09 '23 18:03 mglisse