Skip to content

compute_conditional_distributions

compute_conditional_distributions(interp, trajs, batch_size, nodes_fit, nodes_eval, device='cpu', sigma=0.001, generator=None)

Build conditional training pairs for drift regression.

Parameters:

  • interp (object) –

    Interpolant implementing fit and predict.

  • 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)) –

    Nodes used to fit interpolants.

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

    Nodes where interpolants are evaluated.

  • device (str or device, default: "cpu" ) –

    Device for generated training tensors.

  • sigma (float, default: 0.001 ) –

    Standard deviation of additive Gaussian jitter on interpolated inputs.

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

    Optional RNG for reproducible trajectory sampling and jitter.

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) ) –

    Time derivatives of interpolated states.