Optimal Transport Between Two Matrices
kiasar opened this issue · 2 comments
Hi. I seem not to find a module to calculate the distance between two matrices (with positive values and equal summation of elements). It would be great to have one.
Hello @kiasar ,
The Gromov-Wasserstein distance can be used to compare any pair of matrices, including those you've mentioned. POT includes several solvers for estimating this distance, e.g. 'ot.gromov.gromov_wasserstein', and other features such as the Gromov-Wasserstein barycenter, etc.
I recommend you take a look at the gallery of examples on this subject, e.g https://pythonot.github.io/auto_examples/gromov/plot_fgw.html#sphx-glr-auto-examples-gromov-plot-fgw-py
Hi @cedricvincentcuaz,
Thank you for pointing me to the Gromov-Wasserstein distance and the resources associated with it.
I initially approached this by visualizing the matrix cells as (i, j) points in a 2D space and then utilized ot.emd()
to compute the "cost" as the distance between matrices. Given your expertise in this domain, it would be great to know your opinion: Would the ot.gromov.gromov_wasserstein
method offers advantages or be more appropriate for this task than my approach? (my interest is to cluster the matrices)
Thank you for your guidance.