nifty8.re.structured_kernel_interpolation module#

class HarmonicSKI(grid_shape: Tuple[int], grid_bounds: Tuple[Tuple[float, float]], sampling_points: Array | ndarray, harmonic_kernel: Callable | None = None, padding: float = 0.5, subslice=None, jitter: bool | float | None = True)[source]#

Bases: object

__call__(x, harmonic_kernel=None) Array | ndarray[source]#

Applies the Covariance matrix.

__init__(grid_shape: Tuple[int], grid_bounds: Tuple[Tuple[float, float]], sampling_points: Array | ndarray, harmonic_kernel: Callable | None = None, padding: float = 0.5, subslice=None, jitter: bool | float | None = True)[source]#

Instantiate a KISS-GP model of the covariance using a harmonic representation of the kernel.

Parameters:
  • grid_shape – Number of pixels along each axes of the inducing points within grid_bounds.

  • grid_bounds – Tuple of boundaries of length of the number of dimensions. The boundaries should denote the leftmost and rightmost edge of the modeling space.

  • sampling_points – Locations of the modeled points within the grid.

  • harmonic_kernel – Harmonically transformed kernel.

  • padding – Padding factor which to apply along each axis.

  • subslice – Slice of the inducing points which to use to model sampling_points. By default, the subslice is determined by the padding.

  • jitter – Strength of the diagonal jitter which to add to the covariance.

amplitude(harmonic_kernel=None)[source]#
correlated_field(x, harmonic_kernel=None) Array | ndarray[source]#
evaluate(harmonic_kernel=None)[source]#

Instantiate the full covariance matrix.

evaluate_(kernel) Array | ndarray[source]#
property harmonic_kernel: Callable#

Yields the harmonic kernel specified during initialization or throw a TypeError.

harmonic_transform(x) Array | ndarray[source]#
power(harmonic_kernel=None) Array | ndarray[source]#
sandwich(x, harmonic_kernel=None) Array | ndarray[source]#
class ToeplitzSKI(grid_shape: Tuple[int], grid_bounds: Tuple[Tuple[float, float]], sampling_points: Array | ndarray, kernel: Callable | None = None, jitter: bool | float | None = True)[source]#

Bases: object

__call__(x, kernel=None) Array | ndarray[source]#

Applies the Covariance matrix.

__init__(grid_shape: Tuple[int], grid_bounds: Tuple[Tuple[float, float]], sampling_points: Array | ndarray, kernel: Callable | None = None, jitter: bool | float | None = True)[source]#

Instantiate a KISS-GP model of the covariance using a Toeplitz matrix representation of the kernel.

Parameters:
  • grid_shape – Number of pixels along each axes of the inducing points within grid_bounds.

  • grid_bounds – Tuple of boundaries of length of the number of dimensions. The boundaries should denote the leftmost and rightmost edge of the modeling space.

  • sampling_points – Locations of the modeled points within the grid.

  • kernel – Position space kernel.

  • jitter – Strength of the diagonal jitter which to add to the covariance.

evaluate(kernel=None)[source]#

Instantiate the full covariance matrix.

evaluate_(kernel=None) Array | ndarray[source]#
property kernel: Callable#

Yields the harmonic kernel specified during initialization or throw a TypeError.

interp_mat(grid_shape, grid_bounds, sampling_points, *, distances=None)[source]#
matmul_toeplitz(c, x)[source]#

Efficiently compute the product of an implicit Toeplitz matrix with a vector.

Parameters:
  • c (ndarray) – One-dimensional column of the Toeplitz matrix. It is assumed that the row r is given by r = conjugate(c).

  • x ((M,) or (M, K) ndarray) – Vector or matrix which to multiply from the right to the Toeplitz matrix.

Returns:

Toeplitz @ x – Result of the matrix multiplication.

Return type:

(M,) or (M, K) ndarray