diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/plot_OT_1D.py | 2 | ||||
-rw-r--r-- | examples/plot_OT_2D_samples.py | 5 | ||||
-rw-r--r-- | examples/plot_barycenter_1D.py | 4 | ||||
-rw-r--r-- | examples/plot_barycenter_lp_vs_entropic.py | 4 | ||||
-rw-r--r-- | examples/plot_compute_emd.py | 2 | ||||
-rw-r--r-- | examples/plot_gromov.py | 2 | ||||
-rw-r--r-- | examples/plot_optim_OTreg.py | 4 | ||||
-rw-r--r-- | examples/plot_otda_classes.py | 6 | ||||
-rw-r--r-- | examples/plot_otda_d2.py | 4 | ||||
-rw-r--r-- | examples/plot_otda_mapping.py | 6 | ||||
-rw-r--r-- | examples/plot_otda_semi_supervised.py | 4 |
11 files changed, 22 insertions, 21 deletions
diff --git a/examples/plot_OT_1D.py b/examples/plot_OT_1D.py index 90325c9..f33e2a4 100644 --- a/examples/plot_OT_1D.py +++ b/examples/plot_OT_1D.py @@ -17,7 +17,7 @@ import numpy as np import matplotlib.pylab as pl import ot import ot.plot -from ot.datasets import get_1D_gauss as gauss +from ot.datasets import make_1D_gauss as gauss ############################################################################## # Generate data diff --git a/examples/plot_OT_2D_samples.py b/examples/plot_OT_2D_samples.py index 9818ec5..bb952a0 100644 --- a/examples/plot_OT_2D_samples.py +++ b/examples/plot_OT_2D_samples.py @@ -16,6 +16,7 @@ sum of diracs. The OT matrix is plotted with the samples. import numpy as np import matplotlib.pylab as pl import ot +import ot.plot ############################################################################## # Generate data @@ -31,8 +32,8 @@ cov_s = np.array([[1, 0], [0, 1]]) mu_t = np.array([4, 4]) cov_t = np.array([[1, -.8], [-.8, 1]]) -xs = ot.datasets.get_2D_samples_gauss(n, mu_s, cov_s) -xt = ot.datasets.get_2D_samples_gauss(n, mu_t, cov_t) +xs = ot.datasets.make_2D_samples_gauss(n, mu_s, cov_s) +xt = ot.datasets.make_2D_samples_gauss(n, mu_t, cov_t) a, b = np.ones((n,)) / n, np.ones((n,)) / n # uniform distribution on samples diff --git a/examples/plot_barycenter_1D.py b/examples/plot_barycenter_1D.py index ecf640c..5ed9f3f 100644 --- a/examples/plot_barycenter_1D.py +++ b/examples/plot_barycenter_1D.py @@ -37,8 +37,8 @@ n = 100 # nb bins x = np.arange(n, dtype=np.float64) # Gaussian distributions -a1 = ot.datasets.get_1D_gauss(n, m=20, s=5) # m= mean, s= std -a2 = ot.datasets.get_1D_gauss(n, m=60, s=8) +a1 = ot.datasets.make_1D_gauss(n, m=20, s=5) # m= mean, s= std +a2 = ot.datasets.make_1D_gauss(n, m=60, s=8) # creating matrix A containing all distributions A = np.vstack((a1, a2)).T diff --git a/examples/plot_barycenter_lp_vs_entropic.py b/examples/plot_barycenter_lp_vs_entropic.py index 6936bbb..2255107 100644 --- a/examples/plot_barycenter_lp_vs_entropic.py +++ b/examples/plot_barycenter_lp_vs_entropic.py @@ -47,8 +47,8 @@ x = np.arange(n, dtype=np.float64) # Gaussian distributions # Gaussian distributions -a1 = ot.datasets.get_1D_gauss(n, m=20, s=5) # m= mean, s= std -a2 = ot.datasets.get_1D_gauss(n, m=60, s=8) +a1 = ot.datasets.make_1D_gauss(n, m=20, s=5) # m= mean, s= std +a2 = ot.datasets.make_1D_gauss(n, m=60, s=8) # creating matrix A containing all distributions A = np.vstack((a1, a2)).T diff --git a/examples/plot_compute_emd.py b/examples/plot_compute_emd.py index 73b42c3..7ed2b01 100644 --- a/examples/plot_compute_emd.py +++ b/examples/plot_compute_emd.py @@ -17,7 +17,7 @@ ground metrics and plot their values for diffeent distributions. import numpy as np import matplotlib.pylab as pl import ot -from ot.datasets import get_1D_gauss as gauss +from ot.datasets import make_1D_gauss as gauss ############################################################################## diff --git a/examples/plot_gromov.py b/examples/plot_gromov.py index 5cd40f6..deb2f86 100644 --- a/examples/plot_gromov.py +++ b/examples/plot_gromov.py @@ -38,7 +38,7 @@ mu_t = np.array([4, 4, 4]) cov_t = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
-xs = ot.datasets.get_2D_samples_gauss(n_samples, mu_s, cov_s)
+xs = ot.datasets.make_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
diff --git a/examples/plot_optim_OTreg.py b/examples/plot_optim_OTreg.py index 92df016..2c58def 100644 --- a/examples/plot_optim_OTreg.py +++ b/examples/plot_optim_OTreg.py @@ -42,8 +42,8 @@ n = 100 # nb bins x = np.arange(n, dtype=np.float64) # Gaussian distributions -a = ot.datasets.get_1D_gauss(n, m=20, s=5) # m= mean, s= std -b = ot.datasets.get_1D_gauss(n, m=60, s=10) +a = ot.datasets.make_1D_gauss(n, m=20, s=5) # m= mean, s= std +b = ot.datasets.make_1D_gauss(n, m=60, s=10) # loss matrix M = ot.dist(x.reshape((n, 1)), x.reshape((n, 1))) diff --git a/examples/plot_otda_classes.py b/examples/plot_otda_classes.py index b14c11a..c311fbd 100644 --- a/examples/plot_otda_classes.py +++ b/examples/plot_otda_classes.py @@ -25,8 +25,8 @@ import ot n_source_samples = 150 n_target_samples = 150 -Xs, ys = ot.datasets.get_data_classif('3gauss', n_source_samples) -Xt, yt = ot.datasets.get_data_classif('3gauss2', n_target_samples) +Xs, ys = ot.datasets.make_data_classif('3gauss', n_source_samples) +Xt, yt = ot.datasets.make_data_classif('3gauss2', n_target_samples) ############################################################################## @@ -82,7 +82,7 @@ pl.tight_layout() # Fig 2 : plot optimal couplings and transported samples # ------------------------------------------------------ -param_img = {'interpolation': 'nearest', 'cmap': 'spectral'} +param_img = {'interpolation': 'nearest'} pl.figure(2, figsize=(15, 8)) pl.subplot(2, 4, 1) diff --git a/examples/plot_otda_d2.py b/examples/plot_otda_d2.py index 70beb35..cf22c2f 100644 --- a/examples/plot_otda_d2.py +++ b/examples/plot_otda_d2.py @@ -29,8 +29,8 @@ import ot.plot n_samples_source = 150 n_samples_target = 150 -Xs, ys = ot.datasets.get_data_classif('3gauss', n_samples_source) -Xt, yt = ot.datasets.get_data_classif('3gauss2', n_samples_target) +Xs, ys = ot.datasets.make_data_classif('3gauss', n_samples_source) +Xt, yt = ot.datasets.make_data_classif('3gauss2', n_samples_target) # Cost matrix M = ot.dist(Xs, Xt, metric='sqeuclidean') diff --git a/examples/plot_otda_mapping.py b/examples/plot_otda_mapping.py index 167c3a1..5880adf 100644 --- a/examples/plot_otda_mapping.py +++ b/examples/plot_otda_mapping.py @@ -32,11 +32,11 @@ n_target_samples = 100 theta = 2 * np.pi / 20 noise_level = 0.1 -Xs, ys = ot.datasets.get_data_classif( +Xs, ys = ot.datasets.make_data_classif( 'gaussrot', n_source_samples, nz=noise_level) -Xs_new, _ = ot.datasets.get_data_classif( +Xs_new, _ = ot.datasets.make_data_classif( 'gaussrot', n_source_samples, nz=noise_level) -Xt, yt = ot.datasets.get_data_classif( +Xt, yt = ot.datasets.make_data_classif( 'gaussrot', n_target_samples, theta=theta, nz=noise_level) # one of the target mode changes its variance (no linear mapping) diff --git a/examples/plot_otda_semi_supervised.py b/examples/plot_otda_semi_supervised.py index 7963aef..8a67720 100644 --- a/examples/plot_otda_semi_supervised.py +++ b/examples/plot_otda_semi_supervised.py @@ -29,8 +29,8 @@ import ot n_samples_source = 150 n_samples_target = 150 -Xs, ys = ot.datasets.get_data_classif('3gauss', n_samples_source) -Xt, yt = ot.datasets.get_data_classif('3gauss2', n_samples_target) +Xs, ys = ot.datasets.make_data_classif('3gauss', n_samples_source) +Xt, yt = ot.datasets.make_data_classif('3gauss2', n_samples_target) ############################################################################## |