jax.scipy.interpolate.RegularGridInterpolator#
- class jax.scipy.interpolate.RegularGridInterpolator(points, values, method='linear', bounds_error=False, fill_value=nan)[原始碼]#
在規則矩形網格上內插點。
JAX 實作的
scipy.interpolate.RegularGridInterpolator()
。- 參數:
points – 長度為 N 的陣列序列,指定網格座標。
values – N 維陣列,指定網格值。
method – 內插方法,可以是
"linear"
或"nearest"
。bounds_error – JAX 尚未實作
fill_value – 針對網格外部的點傳回的值,預設為 NaN。
- 傳回:
可呼叫的內插物件。
- 傳回類型:
interpolator
範例
>>> points = (jnp.array([1, 2, 3]), jnp.array([4, 5, 6])) >>> values = jnp.array([[10, 20, 30], [40, 50, 60], [70, 80, 90]]) >>> interpolate = RegularGridInterpolator(points, values, method='linear')
>>> query_points = jnp.array([[1.5, 4.5], [2.2, 5.8]]) >>> interpolate(query_points) Array([30., 64.], dtype=float32)
方法
__init__
(points, values[, method, ...])