UFM_UOT_
UFM_UOT_(dist, times, net, interp=None, growth_model=None, growth_interp=None, bs=None, fac=1, n_epochs=2000, lr=0.001, scheduler_factory=None, paths=None, n_rounds=1, push_steps=8, verbose=True, generator=None)
Train split drift/growth objectives with unbalanced pairwise OT.
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(Module) –Drift model receiving
(x, t)as input. -
interp(object or None, default:None) –Interpolant for state trajectories. If
None,LinearInterpolant()is used. -
growth_model(Module or None, default:None) –Optional growth model receiving spatial coordinates only.
-
growth_interp(object or None, default:None) –Interpolant used for
log(psi_t). -
bs(int or None, default:None) –Number of sampled trajectories per optimization step. If
None, use all sampled trajectories. -
fac(int, default:1) –Number of interpolation nodes per snapshot interval multiplier.
-
n_epochs(int, default:2000) –Number of optimizer iterations.
-
lr(float, default:1e-3) –Learning rate for Adam optimizers.
-
scheduler_factory(callable or None, default:None) –Callable
(optimizer) -> scheduler. IfNone, usesMultiStepLRwithmilestones=[1000, 1500, 8000, 15000], gamma=0.1. -
paths(PathEnsemble or None, default:None) –Path ensemble providing the trajectories (
fit(dist, push)thensample()). IfNone,UnbalancedSinkhorn(reg=0.1, reg_m=10.0)with a growth model, elseSinkhorn(reg=0.1). Map-based paths (e.g.DebiasedSinkhorn) are not supported, and with a growth model the paths must carry masses (paths.weighted, e.g.UnbalancedSinkhorn). -
n_rounds(int, default:1) –Number of rounds of the iterated coupling: every round after the first builds the paths again with the current model as reference dynamics (see
pfi.flow.paths) and repeats the training.1: no iteration. -
push_steps(int, default:8) –Runge-Kutta 4 steps per snapshot interval when pushing with the model.
-
verbose(bool, default:True) –If
True, display progress bars.
Returns:
-
drift_net(Module) –Trained drift model.
-
growth_net(Module or None) –Trained growth model, or
None. -
loss_hist(list) –Two-list history
[flow_loss_hist, growth_loss_hist].