ls_mlkit.util.interp module

ls_mlkit.util.interp.interp(x: Tensor, xp: Tensor, fp: Tensor) Tensor[source]

1D linear interpolation in PyTorch, similar to numpy.interp. Supports x with arbitrary shape. … := macro_shape

Parameters:
  • x (Tensor) – The x-coordinates to interpolate at. Shape (…,)

  • xp (Tensor) – The x-coordinates of the data points. Shape (M,)

  • fp (Tensor) – The y-coordinates of the data points. Shape (…, M,)

Returns:

Interpolated values at x. Shape (…,)

Return type:

Tensor

ls_mlkit.util.interp.interp_1d(x: Tensor, xp: Tensor, fp: Tensor) Tensor[source]

1D linear interpolation in PyTorch, similar to numpy.interp. Supports x with arbitrary shape.

Parameters:
  • x (Tensor) – The x-coordinates to interpolate at. Shape (…,)

  • xp (Tensor) – The x-coordinates of the data points. Shape (M,)

  • fp (Tensor) – The y-coordinates of the data points. Shape (M,)

Returns:

Interpolated values at x. Shape (…,)

Return type:

Tensor