aliutkus / torchinterp1d

1D interpolation for pytorch
BSD 3-Clause "New" or "Revised" License
162 stars 19 forks source link

extend to 2d #15

Open twangnh opened 1 year ago

twangnh commented 1 year ago

hi @aliutkus thanks for sharing the wonderful work, I'm wondering how to extend the function to 2d points?

aliutkus commented 1 year ago

Hi, thanks for your interest. Good question, yes I guess it's feasible, and requires some multidimensionnel generalization to searchsorted. The common way is to use Delaunay triangulation. Both matlab and scipy have this. See for instance https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.LinearNDInterpolator.html#scipy.interpolate.LinearNDInterpolator It would basically mean porting that code to torch...

je-santos commented 1 year ago

Did anyone ended-up working on this? Seems like a cool idea.