Skip to content

Implementations of some optimal transport and network flow algorithms in Futhark.

Notifications You must be signed in to change notification settings

patrick-nicodemus/futhark_ot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Project structure

common.fut

Hopefully self explanatory, contains basic functionality for matrix operations and stuff associated to GW

scaling_generic.fut

Here we are trying to define a general framework in which to carry out the unbalanced optimal transport.

entropic_gw.fut

Common parameters

These parameters are used in many versions of the unbalanced Gromov-Wasserstein function.

  • rho1, rho2: marginal penalty costs, using notation from the “Unbalanced Gromov-Wasserstein” paper. When rho1 (respectively rho2) are chosen higher, there is more of a cost paid to diverge from the appropriate marginals of the transport plan (create or destroy mass). As rho1, rho2 approach infinity, we converge to usual GW (with regularization parameter epsilon.) As rho1 approaches infinity we converge to a transport plan that embeds the first space itrometrically into the second.
  • epsilon: Entropy penalty, for regularization, using notation from the UGW paper.
  • exp_absorb_cutoff: A numerical stability parameter. The algorithm maintains an internal transport plan whose entries tend to diverge to +∞ or possibly 0. When entries in the matrix for the transport plan exceed exp_absorb_cutoff, or take on a value less than 1/exp_absorb_cutoff, an rescaling step is taken which rescales that row or column to a normal range while absorbing the logarithm of the extreme value into a separately stored array, i.e., the representation (a, x) for a * e^x is replaced with (a * log(m), x-m) for m chosen so that x-m lies in a convenient range. Choose exp_absorb_cutoff to be much less than the maximum value for a floating point number, I have been using 10^30 but probably 10^100 would be okay for 64 bits.
  • safe_for_exp: This is a numerical stability parameter which is used only once at the very beginning of the algorithm to choose a transform of the initial transport plan into safe values. Choose safe_for_exp such that, if -safe_for_exp < x < safe_for_exp, then e^x will be within a reasonable range in (0, ∞). I have been using 30.
  • tol_sinkhorn: This controls the exit condition of the inner Sinkhorn loop, which iteratively modifies the row and column scaling factors of the inner transport plan. The inner loop exits when the arithmetic difference between the old row scaling coefficients and new row scaling coefficients is less than tol_sinkhorn.
  • tol_outerloop: This controls the exit condition of the outer loop, which is minimizing the overall unbalanced Gromov-Wasserstein cost. It controls the arithmetic error between successive transport plans (directly, not in the form of the scaling coefficients.)

About

Implementations of some optimal transport and network flow algorithms in Futhark.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published