BayesFlow icon indicating copy to clipboard operation
BayesFlow copied to clipboard

Add conditional optimal transport for flow matching

Open arrjon opened this issue 4 weeks ago • 1 comments

This pull request introduces significant improvements to the optimal transport functionality, with a focus on supporting partial and conditional optimal transport in both the Sinkhorn and Log-Sinkhorn algorithms.

  • Added support for partial optimal transport and conditional optimal transport in both Sinkhorn and Log-Sinkhorn algorithms. Both can in principle learn a better transport map for conditional flow matching.
  • Refactored the Sinkhorn and Log-Sinkhorn methods to improve computational efficiency (using the dual optimization problem).
  • Updated the optimal_transport API to accept and correctly propagate conditions, and to return resampled conditions and assignments for both balanced and unbalanced (partial/conditional) settings.
  • Changed default configuration values and documentation to reflect new options and recommended settings for conditional optimal transport.
  • Refactored code in flow_matching.py to handle new outputs from the optimal transport functions and to properly resample conditions when provided.

arrjon avatar Dec 21 '25 17:12 arrjon