Interpolation and function approximation with JAX
Project description
interpax is a library for interpolation and function approximation using JAX.
Includes methods for nearest neighbor, linear, and several cubic interpolation schemes in 1d, 2d, and 3d, as well as Fourier interpolation for periodic functions in 1d and 2d.
Coming soon: - Spline interpolation for rectilinear grids in N-dimensions - RBF interpolation for unstructured data in N-dimensions - Smoothing splines for noisy data
Installation
interpax is installable with pip:
pip install interpax
Usage
import jax.numpy as jnp
import numpy as np
from interpax import interp1d
xp = jnp.linspace(0, 2 * np.pi, 100)
xq = jnp.linspace(0, 2 * np.pi, 10000)
f = lambda x: jnp.sin(x)
fp = f(xp)
fq = interp1d(xq, xp, fp, method="cubic")
np.testing.assert_allclose(fq, f(xq), rtol=1e-6, atol=1e-5)
For full details of various options see the API documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
interpax-0.3.3.tar.gz
(55.9 kB
view hashes)
Built Distribution
interpax-0.3.3-py3-none-any.whl
(26.6 kB
view hashes)