diff options
Diffstat (limited to 'examples/plot_gromov.py')
-rw-r--r-- | examples/plot_gromov.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/plot_gromov.py b/examples/plot_gromov.py index 92312ae..99aaf81 100644 --- a/examples/plot_gromov.py +++ b/examples/plot_gromov.py @@ -26,7 +26,11 @@ The Gromov-Wasserstein distance allows to compute distances with samples that do For demonstration purpose, we sample two Gaussian distributions in 2- and 3-dimensional spaces.
"""
+<<<<<<< HEAD n_samples = 30 # nb samples
+======= +n = 30 # nb samples
+>>>>>>> 986f46ddde3ce2f550cb56f66620df377326423d mu_s = np.array([0, 0])
cov_s = np.array([[1, 0], [0, 1]])
@@ -35,9 +39,15 @@ mu_t = np.array([4, 4, 4]) cov_t = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
+<<<<<<< HEAD xs = ot.datasets.get_2D_samples_gauss(n_samples, mu_s, cov_s)
P = sp.linalg.sqrtm(cov_t)
xt = np.random.randn(n_samples, 3).dot(P) + mu_t
+======= +xs = ot.datasets.get_2D_samples_gauss(n, mu_s, cov_s)
+P = sp.linalg.sqrtm(cov_t)
+xt = np.random.randn(n, 3).dot(P) + mu_t
+>>>>>>> 986f46ddde3ce2f550cb56f66620df377326423d """
@@ -75,8 +85,13 @@ Compute Gromov-Wasserstein plans and distance =============================================
"""
+<<<<<<< HEAD p = ot.unif(n_samples)
q = ot.unif(n_samples)
+======= +p = ot.unif(n)
+q = ot.unif(n)
+>>>>>>> 986f46ddde3ce2f550cb56f66620df377326423d gw = ot.gromov_wasserstein(C1, C2, p, q, 'square_loss', epsilon=5e-4)
gw_dist = ot.gromov_wasserstein2(C1, C2, p, q, 'square_loss', epsilon=5e-4)
|