You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to compute an OT map between two distributions in 2D defined on $[0,1]^2$ using ot.EMDTransport. My goal is to essentially build a semi-continuous map on dense, regular samples so that I can use it on new, unseen data, similar what is done in the domain adaptation examples.
In my particular case, I only have access to samples xt from the target and I wish to construct an OT map from the unit square $[0,1]^2$ to the target domain (also $[0,1]^2$). I do so by densely sampling the square to create source samples xs. When I call my_ot_map.transform(xs) and my_ot_map.inverse_transform(xt), I do get a satisfying result (top row, see plot), except a few missing points which I am not sure of. However, when I try on new, coarser data (bottom row), the inverse map looks wrong. Why is that?
I dug into the code for inverse and saw that is uses nearest neighbors to weight the original transport map. Given my source samples are quite higher resolution, shouldn't the inverse be well approximated? Also, intuitively we should use the barycentric weights instead, is there an implementation of that somewhere?
I should have prefaced this by saying I am not by any mean an expert in optimal transport, so perhaps I am doing/expecting something wrong.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying to compute an OT map between two distributions in 2D defined on$[0,1]^2$ using
ot.EMDTransport
. My goal is to essentially build a semi-continuous map on dense, regular samples so that I can use it on new, unseen data, similar what is done in the domain adaptation examples.In my particular case, I only have access to samples$[0,1]^2$ to the target domain (also $[0,1]^2$ ). I do so by densely sampling the square to create source samples
xt
from the target and I wish to construct an OT map from the unit squarexs
. When I callmy_ot_map.transform(xs)
andmy_ot_map.inverse_transform(xt)
, I do get a satisfying result (top row, see plot), except a few missing points which I am not sure of. However, when I try on new, coarser data (bottom row), the inverse map looks wrong. Why is that?I dug into the code for inverse and saw that is uses nearest neighbors to weight the original transport map. Given my source samples are quite higher resolution, shouldn't the inverse be well approximated? Also, intuitively we should use the barycentric weights instead, is there an implementation of that somewhere?
I should have prefaced this by saying I am not by any mean an expert in optimal transport, so perhaps I am doing/expecting something wrong.
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions