Replies: 4 comments
-
Hello, I have a start of implementation that uses the fast exact solver on cpu but with a seamless cpu/gpu wrapper for torch. The actual solving is not done on GPU but i have found that the overhead is quite small in practice. https://github.com/PythonOT/POT/tree/torch I am not a aware of a true GPU opens source exact OT solver for the general emd problem (general cost function). Please tell us if you find one. |
Beta Was this translation helpful? Give feedback.
-
Thank you, I'll take a look.
I'd like to clarify (sorry for ambiguity): by "EMD" I mean the general Optimal Transport problem with a specific cost matrix that is formed by euclidean (not squared) distances (I refer to the terminology suggested somewhere by the author of [geomloss](https://www.kernel-operations.io/geomloss/api/pytorch-api.html; in terms of their APIs, I am looking for solvers with p=1). This is why "EMD is hardcoded" will also work for me. P.S. Probably worth mentioning that gradients is also not a requirement, I am just looking for fast ways of optimal plans calculation. |
Beta Was this translation helpful? Give feedback.
-
Hi @Yura52 , sorry for delay. EMD can be solved with any type of cost matrix. As for mini-batch, I do not think it is possible to solve the exact OT problem in a batch setting. You can do batch (with stochastic descent) if you add some regularizations to the problem (thus leading to 'smoother' solutions) or consider a mini-batch strategy such as in this paper https://arxiv.org/pdf/1910.04091.pdf, but again the result will not be the exact OT distance/coupling.... |
Beta Was this translation helpful? Give feedback.
-
I mean a batch of independent optimal transport problems with inputs of the same dimensions. As for EMD terminology, I still encounter different definitions, but I got your point :) |
Beta Was this translation helpful? Give feedback.
-
Hi! I am looking for replacements for the OpenCV solver.
My requirements are:
(1) precise solver (i.e. Sinkhorn-like solvers is not an option)
(2) GPU-acceleration
(3) it is possible to pass custom cost matrix (or EMD is hardcoded)
(4) ideally, with batched calculation
As far as I can see,
ot.gpu
offers only approximate solvers, right? If so, are you aware of any other projects that are relevant to my query? I realize that this is not a "POT issue", sorry for that, just don't know where to ask (Google doesn't help).Beta Was this translation helpful? Give feedback.
All reactions