-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negative cost in OTTOutput #769
Comments
Hi @matthieuheitz , Thanks for opening this issue. A negative cost is possible because we (following ott-jax) report the entropy-regularized optimal transport cost. The For the case
|
Yeah, I don't know where this
It looks like the setting of the |
I guess that would be some numerical overflow. Are you running it with dtype 32 or 64? If 32, could you try with dtype 64? @michalk8 , do you have any idea where this might come from? |
I'm computing all pair distances between 6 spatial transcriptomics slices, and some of them have negative costs, and even absurdly large numbers, even though they have converged.
I prepared the problem like this:
stp = stp.prepare(time_key="Batch_idx",spatial_key="spatial",joint_attr=joint_attr,cost='sq_euclidean',policy="triu")
where joint_attr="X_pca" is a global PCA.
Here's my call to the solver, and the output:
I then tried to change some parameters of the solvers to see if it would matter, and it seems it does.
Removing the epsilon decay, we only get 3 negative values (and a nan).
Removing the epsilon decay, and choosing a fixed momentum, we still have 4 negative values, but still a few (and many problems didn't converge, but I'm not sure that's relevant).
What's strange is that it's not always the same problems that have a negative cost. Though (0,3) and (0,2) seem to always be negative, and others are on and off.
Any idea what could be causing this?
Thanks!
The text was updated successfully, but these errors were encountered: