Interpolation

class Interpolation(*args, **kwargs)[source]

Bases: Protocol

Callable used to interpolate in time between two tensors.

Here, prev_data and next_data should be the nearest two observations, and sample_at should be the length of time, since prev_data was observered, from which to sample. step_time is the total length of time between the observations prev_data and next_data.

The result is a single tensor, shaped like prev_data and next_data, containing the interpolated data.

Parameters:
  • prev_data (torch.Tensor) – most recent observation prior to sample time.

  • next_data (torch.Tensor) – most recent observation subsequent to sample time.

  • sample_at (torch.Tensor) – relative time at which to sample data.

  • step_time (float) – length of time between the prior and subsequent observations.

Returns:

interpolated data at sample time.

Return type:

torch.Tensor