Extrapolation

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

Bases: Protocol

Callable used to extrapolate in time to two tensors.

Here, sample should be the tensor which was “sampled” at a time between two discrete observations, prev_data and next_data. sample_at should be the length of time between the prior observation and this sample. step_time is the total length of time between the nearest two observations.

The result is a 2-tuple of tensors, both shaped like data, the first being the the extrapolated data at the time of the nearest prior discrete observation and the second being the extrapolated data at the time of the nearest subsequent discrete observations.

Parameters:
  • sample (torch.Tensor) – sample from which to extrapolate.

  • sample_at (torch.Tensor) – relative time of the data from which to extrapolate.

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

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

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

Returns:

extrapolated data at the start and end of the step.

Return type:

tuple[torch.Tensor, torch.Tensor]