python-adaptive / adaptive

:chart_with_upwards_trend: Adaptive: parallel active learning of mathematical functions
http://adaptive.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.13k stars 58 forks source link

question: Does there exist a method to get the Delaunay neighbours for points not in the mesh? #341

Open cottrell opened 2 years ago

cottrell commented 2 years ago

For example to do some sort of inference using Delaunay neighborhoods as a nearest-neighbor topology you might for a Delaunay triangulation with your "train" points. The for each of the inference points you need the neighbours. This is effectively like one-by-one adding a point to the triangulation, running the Bowyer Watson on that, finding the neighbours and then deleting that point. There are optimization to make this faster but that is the gist I think.

It looks like bowyer_watson of triangulation could be modified to be stateless and then this procedure could be parallelized across the inference points and the base train triangulation cost shared.

Does this already exist somewhere in the code? I have read through the learners a bit but it seems their concerns are somewhat different as they are adding points where I think the test function will be probed.

akhmerov commented 2 years ago

Do you need to do it only once after sampling is completed or in the process of sampling? If the former, then you could as well use scipy's Delaunay tesselation. If the latter, that indeed, to the best of my recollection, this needs a code modification. It should be within reach and would be a reasonable enhancement.