extrap_linear_forward

extrap_linear_forward(sample: Tensor, sample_at: Tensor, prev_data: Tensor, next_data: Tensor, step_time: float, *, adjust: Callable[[Tensor], Tensor] | None = None, **kwargs) tuple[Tensor, Tensor][source]

Extrapolates out linearly to the next state.

\[\begin{split}\begin{align*} X(0) &= f(D(0)) \\ X(\Delta t) &= X(0) + \left(\frac{X(t_s) - X(0)}{t_s} \right) \Delta t \end{align*}\end{split}\]
Parameters:
  • sample (torch.Tensor) – sample from which to extrapolate, \(X(t=t_s)\)

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

  • prev_data (torch.Tensor) – most recent observation prior to sample time, \(D(t=0)\).

  • next_data (torch.Tensor) – most recent observation subsequent to sample time, \(D(t=\Delta t)\).

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

  • adjust (Callable[[torch.Tensor], torch.Tensor] | None, optional) – function to apply to the previous state before extrapolating, identity when None, \(f\). Defaults to None.

Returns:

extrapolated data at neighboring steps, \((X(t=0), X(t=\Delta t))\).

Return type:

tuple[torch.Tensor, torch.Tensor]