Skip to content

PFM_LINEAR_

PFM_LINEAR_(dist, times, net, interp=None, paths=None, growth_model=None, fac=4, t_eval=None, ridge=0.0, n_rounds=1, anderson=0, safeguard=True, tol=None, push_steps=8, history=None, verbose=True, generator=None)

Fit OUFlow in closed form by flow matching on path ensembles.

Every round: (1) the model's flow is the reference dynamics (none in round 1), (2) the paths are built and sampled, (3) they are interpolated at the evaluation times, (4) the score is evaluated there, and (5) B is fitted by exact least squares.

Parameters:

  • dist (list of torch.Tensor) –

    Snapshot list where dist[k] has shape (n_k, ndim).

  • times (torch.Tensor of shape (n_snaps,)) –

    Snapshot times.

  • net (OUFlow) –

    Model, without feature or batch normalization. Its drift matrix net.net_.B is set to the solution.

  • interp (object or None, default: None ) –

    Interpolant implementing fit and predict. If None, ChebyshevInterpolant().

  • paths (PathEnsemble or None, default: None ) –

    Path ensemble. If None, ExactOT().

  • growth_model (None, default: None ) –

    Not supported (must be None).

  • fac (int, default: 4 ) –

    Evaluation times per snapshot (uniform grid over the window, as in PFM_).

  • t_eval (array - like or None, default: None ) –

    Explicit evaluation times (e.g. interval midpoints); overrides fac.

  • ridge (float, default: 0.0 ) –

    Ridge penalty ridge * ||B||_F^2 on the time-averaged loss.

  • n_rounds (int, default: 1 ) –

    Rounds of the iterated coupling (1: no iteration).

  • anderson (int, default: 0 ) –

    Anderson memory on B (0: plain iteration).

  • safeguard (bool, default: True ) –

    Keep an Anderson step only if the residual does not grow.

  • tol (float or None, default: None ) –

    Stop when the relative change of B is below tol.

  • push_steps (int, default: 8 ) –

    Runge-Kutta 4 steps per snapshot interval when pushing with the model.

  • history (list or None, default: None ) –

    If a list, receives one dict per round: round, change (relative change of B, NaN for round 1) and B.

  • verbose (bool, default: True ) –

    If True, print one line per round.

  • generator (Generator or None, default: None ) –

    RNG of the path sampling, reset at every round so that all rounds use the same draws (the round map is then deterministic). If None, a generator seeded with 0.

Returns:

  • net ( OUFlow ) –

    Fitted model.

  • growth_model ( None ) –

    Always None.

  • loss_hist ( list of float ) –

    Relative change of B per round (NaN for round 1).