Re: Interpolating in three dimensions

Sara Fridovich-Keil <[email protected]> Wed, 5 Jul 2023 14:11:47 -0700
Newsgroups gmane.comp.python.scientific.devel
Message-ID <[email protected]>
Hi Fabian,

Thanks for writing this interpolator! I can offer a little info to Stéfan’s question about what has been done since 2005, though I’m sure my knowledge is also incomplete. In one of my projects I had a similar need and wrote a tricubic interpolator in JAX <https://github.com/sarafridov/plenoxels/blob/main/plenoxel.py#L340> (which provides automatic differentiation, though I’m not sure how the speed/accuracy/memory use compare to your implementation). I’m also aware of implementations of trilinear interpolation in both JAX <https://jax.readthedocs.io/en/latest/_autosummary/jax.scipy.ndimage.map_coordinates.html> and PyTorch <https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html>—technically trilinear interpolation isn’t smooth, but these library implementations still give “derivatives” (presumably subgradients) that seem fine for optimization purposes, and trilinear runs much faster than tricubic since it requires checking fewer neighbors. 

Best,
Sara

> On Jul 5, 2023, at 12:14 PM, Stefan van der Walt <[email protected]> wrote:
> 
> Hi Fabian,
> 
> On Wed, Jul 5, 2023, at 11:28, Fabian Gittins via SciPy-Dev wrote:
>> I came across this paper 
>> (http://www.cds.caltech.edu/~marsden/bib/2005/08-LeMa2005/LeMa2005.pdf), 
>> which describes (local) tricubic interpolation in three dimensions that 
>> is continuous in the function and its first derivatives.
> 
> Thanks for your offer to contribute a new feature to SciPy!
> 
> It sounds useful to have higher accuracy interpolation derivatives available. Have you compared the results with those from SciPy on some synthetic data to see how they differ, both in result and derivative accuracy?  I'd also be curious to see what work has been done in this area since 2005.
> 
> Thanks to Trever Hines, our Radial Basis Function interpolation routines were much improved recently. I'm rusty, but I vaguely recall that it may be possible to calculate the derivative of those interpolations? See, e.g., [1].
> 
> Stéfan
> 
> [1] https://www.colorado.edu/amath/sites/default/files/attached-files/rbf_1.pdf
> _______________________________________________
> SciPy-Dev mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/scipy-dev.python.org/
> Member address: [email protected]

_______________________________________________
SciPy-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/scipy-dev.python.org/
Member address: [email protected]