POT
POT copied to clipboard
Nan in metric cost matrix causes 'segmentation fault core dumped' for GW solver
Bug
Hello! When there is a nan in the metric cost matrix (gromov_wasserstein or fused_gromov_wasserstein) I get a 'segmentation fault core dumped' error.
Code sample
import numpy as np
from ot import gromov_wasserstein2
C1 = np.zeros((2,2))
C2 = np.ones((2,2))
p = np.array([0.5,0.5])
q = np.array([0.5,0.5])
gromov_wasserstein2(C1, C2, p, q)
C1[0,0]=np.nan
gromov_wasserstein2(C1, C2, p, q)
Expected behavior
I would expect a more clear warning/error or even that gromov_wasserstein2 returns a nan.
Hi, I would be interested in working on this! Could you please assign it to me?
OK great! Feel free to cone POT and work on it the do a PR so that we can look at the code and discus it.