Replies: 1 comment 3 replies
-
Actually, when i run your code there is a warning that numerical error occured which means that teh returned plan is not a proper OT plan and violates the marginal contraints For instance in your solution violates the marginal contraintsbecaiuse the retured plan has uniform weights and your weights are sparse. Sinkhorn is particularly bad at solving sparse problems. For those i suggets to use exact OT : n = 100 # nb bins
x = torch.arange(n,dtype=torch.float64)
M = ot.dist(x.reshape((n, 1)), x.reshape((n, 1)), 'euclidean')
l1 = torch.zeros(100)
l2 = torch.zeros(100)
l1[0] = 1.0
l2[1] = 1.0
lambd = 1e-3
Gs1 = ot.emd(l1, l2, M)
print (Gs1) that returns
and for the second problem:
both are the correct solutions. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
H! @rflamary
This is a really cool library. I was wondering if you can provide me with any insights on this problem -
I am trying to find the distance between two distributions, for example -
The output I get is -
Since the source and target are close by I want the wasserstein distance to be smaller here.
But for distributions looking like this -
The output I get is -
which also is same? How can I get the distance for this to be larger than the first one? Any insights are welcome. Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions