dymad.models.prediction¶
Functions
|
Predict trajectory(ies) for continuous-time models with batch support. |
|
Predict trajectory(ies) for continuous-time models with batch support. |
|
Predict trajectory(ies) using First-order Euler with Normal Correction (FENC). |
|
Predict trajectory(ies) for continuous-time models with batch support. |
|
Predict trajectory(ies) for discrete-time models with batch support. |
|
Predict trajectory(ies) for discrete-time models with batch support. |
- dymad.models.prediction.predict_continuous(model, x0, ts, ws=None, method='dopri5', order='cubic', **kwargs)¶
Predict trajectory(ies) for continuous-time models with batch support.
- Parameters:
model – Model with encoder, decoder, and dynamics methods.
x0 (torch.Tensor) –
Initial state(s).
Single: shape (n_features,)
Batch: shape (batch_size, n_features)
ts (Union[np.ndarray, torch.Tensor]) – Time points (n_steps,).
ws (
TypeAliasType|None) – Dataclass containing additional information, e.g., u, p, ei, ew, etc.method (str) – ODE solver method (default: ‘dopri5’).
order (str) – Interpolation method for control inputs (‘zoh’, ‘linear’, or ‘cubic’).
- Returns:
Predicted trajectory(ies).
Single: shape (n_steps, n_features)
Batch: shape (batch_size, n_steps, n_features)
- Return type:
torch.Tensor
- dymad.models.prediction.predict_continuous_exp(model, x0, ts, ws=None, **kwargs)¶
Predict trajectory(ies) for continuous-time models with batch support.
Autonomous case using matrix exponential. In continuous-time, we compute exp(A*dt).
The step size is assumed to be constant, so when there are batched time series, we just take the first one to compute dt.
Currently only for KBF-type models with linear dynamics.
- Return type:
Tensor
- dymad.models.prediction.predict_continuous_fenc(model, x0, ts, ws=None, **kwargs)¶
Predict trajectory(ies) using First-order Euler with Normal Correction (FENC).
Currently only for kernel machine with tangent kernel.
- Return type:
Tensor
- dymad.models.prediction.predict_continuous_np(model, x0, ts, ws=None, method='dopri5', order='cubic', **kwargs)¶
Predict trajectory(ies) for continuous-time models with batch support.
No-projection version, meaning during ODE integration, we do not decode back to the observation space and encode back; the decoding happens only at the end.
- Return type:
Tensor
- dymad.models.prediction.predict_discrete(model, x0, ts, ws=None, **kwargs)¶
Predict trajectory(ies) for discrete-time models with batch support.
- Parameters:
model – Model with encoder, decoder, and dynamics methods
x0 (
Tensor) –Initial state(s):
Single: (n_features,)
Batch: (batch_size, n_features)
ts (Union[np.ndarray, torch.Tensor]) – Time points (n_steps,).
ws (
TypeAliasType|None) – Dataclass containing additional information, e.g., u, p, ei, ew, etc.
- Returns:
Predicted trajectory(ies)
Single: (n_steps, n_features)
Batch: (batch_size, n_steps, n_features)
- Return type:
torch.Tensor
- dymad.models.prediction.predict_discrete_exp(model, x0, ts, ws=None, **kwargs)¶
Predict trajectory(ies) for discrete-time models with batch support.
In discrete-time, this is equivalent to repeated application of the dynamics.
- Return type:
Tensor