bundles / scipy 1.17.1 / scipy / interpolate / _rbfinterp_xp
module
scipy.interpolate._rbfinterp_xp
Members
-
_build_and_solve_system -
_build_evaluation_coefficients -
_build_system -
_monomial_powers -
compute_interpolation -
cubic -
gaussian -
inverse_multiquadric -
inverse_quadratic -
kernel_matrix -
linear -
multiquadric -
polynomial_matrix -
quintic -
thin_plate_spline
Summary
'Generic' Array API backend for RBF interpolation.
Extended Summary
The general logic is this: _rbfinterp.py implements the user API and calls into either _rbfinterp_np (the "numpy backend"), or _rbfinterp_xp (the "generic backend".
The numpy backend offloads performance-critical computations to the pythran-compiled _rbfinterp_pythran extension. This way, the call chain is
_rbfinterp.py <-- _rbfinterp_np.py <-- _rbfinterp_pythran.py
The "generic" backend here is a drop-in replacement of the API of _rbfinterp_np.py for use in _rbfinterp.py with non-numpy arrays.
The implementation closely follows _rbfinterp_np + _rbfinterp_pythran, with the following differences:
We used vectorized code not explicit loops in
_build_systemand_build_evaluation_coefficients; this is more torch/jax friendly;RBF kernels are also "vectorized" and not scalar: they receive an array of norms not a single norm;
RBF kernels accept an extra xp= argument;
In general, we would prefer less code duplication. The main blocker ATM is that pythran cannot compile functions with an xp= argument where xp is numpy.
Additional content
'Generic' Array API backend for RBF interpolation.
The general logic is this: _rbfinterp.py implements the user API and calls into either _rbfinterp_np (the "numpy backend"), or _rbfinterp_xp (the "generic backend".
The numpy backend offloads performance-critical computations to the pythran-compiled _rbfinterp_pythran extension. This way, the call chain is
_rbfinterp.py <-- _rbfinterp_np.py <-- _rbfinterp_pythran.py
The "generic" backend here is a drop-in replacement of the API of _rbfinterp_np.py for use in _rbfinterp.py with non-numpy arrays.
The implementation closely follows _rbfinterp_np + _rbfinterp_pythran, with the following differences:
We used vectorized code not explicit loops in
_build_systemand_build_evaluation_coefficients; this is more torch/jax friendly;RBF kernels are also "vectorized" and not scalar: they receive an array of norms not a single norm;
RBF kernels accept an extra xp= argument;
In general, we would prefer less code duplication. The main blocker ATM is that pythran cannot compile functions with an xp= argument where xp is numpy.
Aliases
-
scipy.interpolate._rbfinterp_xp