POT icon indicating copy to clipboard operation
POT copied to clipboard

Nan in metric cost matrix causes 'segmentation fault core dumped' for GW solver

Open KrzakalaPaul opened this issue 2 years ago • 2 comments

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.

KrzakalaPaul avatar May 03 '23 14:05 KrzakalaPaul

Hi, I would be interested in working on this! Could you please assign it to me?

bobluppes avatar May 17 '24 07:05 bobluppes

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.

rflamary avatar May 17 '24 07:05 rflamary