fenestration.sampling.create_movie#

fenestration.sampling.create_movie(interpolated: ndarray, residuals: ndarray, x: Tensor | ndarray | None = None, full: ndarray | None = None, framerate: int = 10) → FuncAnimation#

Create movie showing the interpolation results.

We create a simple movie to show this in action. we have two subplots: the interpolation (with optional actual values) and the residuals.

the more finely sampled your x was when calling check_sampling (and thus the larger your interpolated and full arrays), the longer this will take. Calling this function will not take too long, but displaying or saving the returned animation will.

Parameters:
  • interpolated – the array of functions interpolated to each pixel

  • residuals – the errors for each interpolation

  • x – the 1d tensor/array passed to check_sampling. If x is not set, default is torch.linspace(-5, 5, 101) as in check_sampling.

  • full – the array of functions centered at each pixel. If None, won’t plot. If not None, will plot as dashed line behind the interpolation for comparison

  • framerate – How many frames a second to display.

Returns:

anim – The animation object.