![](https://secure.gravatar.com/avatar/011032de88dfde1d035971683e3683eb.jpg?s=120&d=mm&r=g)
Hi, I'm using OT package for GW, and I have a question regarding two arguments of the ot.gromov.gromov_wasserstein function. What is p and q? I couldn't see them in the objective function of the GW. p = ot.unif(n_samples)q = ot.unif(n_samples) gw0, log0 = ot.gromov.gromov_wasserstein( C1, C2, p, q, 'square_loss', verbose=True, log=True) gw, log = ot.gromov.entropic_gromov_wasserstein( C1, C2, p, q, 'square_loss', epsilon=5e-4, log=True, verbose=True) print('Gromov-Wasserstein distances: ' + str(log0['gw_dist']))print('Entropic Gromov-Wasserstein distances: ' + str(log['gw_dist']))
![](https://secure.gravatar.com/avatar/c3bcfbf37a00feea04b173375450c6b2.jpg?s=120&d=mm&r=g)
Hello Azim, Since we are manipulating empirical probability distributions, p and q are vectors of probability masses per samples in your distribution. Indeed, it is generally a common choice to consider them as equal and set them as 1/(number of samples in the distribution). Hope this helps, Best regards, Nicolas
Le 8 août 2019 à 21:53, Azim Dehghani Amirabad <azim.dehghani@gmail.com> a écrit :
Hi,
I'm using OT package for GW, and I have a question regarding two arguments of the ot.gromov.gromov_wasserstein function. What is p and q? I couldn't see them in the objective function of the GW.
p = ot.unif(n_samples) q = ot.unif(n_samples)
gw0, log0 = ot.gromov.gromov_wasserstein( C1, C2, p, q, 'square_loss', verbose=True, log=True)
gw, log = ot.gromov.entropic_gromov_wasserstein( C1, C2, p, q, 'square_loss', epsilon=5e-4, log=True, verbose=True)
print('Gromov-Wasserstein distances: ' + str(log0['gw_dist'])) print('Entropic Gromov-Wasserstein distances: ' + str(log['gw_dist'])) _______________________________________________ POT mailing list -- pot@python.org To unsubscribe send an email to pot-leave@python.org https://mail.python.org/mailman3/lists/pot.python.org/
![](https://secure.gravatar.com/avatar/7bc4987c53fd6218d05cfe9e51a23c56.jpg?s=120&d=mm&r=g)
Bon à entendre, peut partager plus d'informations avec nous. https://bit.ly/3yVeKoF
participants (3)
-
Azim Dehghani Amirabad
-
Cheryl Grant
-
Nicolas Courty