Skip to content

compute_conditional_distributions_unbalanced

compute_conditional_distributions_unbalanced(interp, growth_interp, psi_traj, trajs, batch_size, nodes_fit, nodes_eval, sigma=0.001, generator=None)

Build weighted training pairs for unbalanced flow matching.

Parameters:

  • interp (object) –

    Interpolant for state trajectories.

  • growth_interp (object) –

    Interpolant for log(psi_t) trajectories.

  • psi_traj (torch.Tensor of shape (ntraj, n_snaps)) –

    Per-trajectory endpoint weights in trajectory-first layout.

  • trajs (torch.Tensor of shape (ntraj, n_snaps, ndim)) –

    OT-stitched trajectories in trajectory-first layout.

  • batch_size (int) –

    Number of sampled trajectories per optimization step.

  • nodes_fit (torch.Tensor of shape (batch_size, n_snaps)) –

    Interpolant fit nodes.

  • nodes_eval (torch.Tensor of shape (batch_size, n_eval)) –

    Interpolant evaluation nodes.

  • sigma (float, default: 0.001 ) –

    Standard deviation of additive Gaussian jitter on interpolated inputs.

Returns:

  • xtrain ( torch.Tensor of shape (batch_size * n_eval, ndim + 1) ) –

    Interpolated states with time appended.

  • ytrain ( torch.Tensor of shape (batch_size * n_eval, ndim) ) –

    Interpolated drift targets.

  • wtrain ( torch.Tensor of shape (batch_size * n_eval,) ) –

    Interpolated mass weights psi_t.

  • gtrain ( torch.Tensor of shape (batch_size * n_eval,) ) –

    Interpolated growth targets d/dt log(psi_t).