diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/plot_OTDA_color_images.py | 2 | ||||
-rw-r--r-- | examples/plot_OTDA_mapping_color_images.py | 2 | ||||
-rw-r--r-- | examples/plot_optim_OTreg.py | 3 |
3 files changed, 7 insertions, 0 deletions
diff --git a/examples/plot_OTDA_color_images.py b/examples/plot_OTDA_color_images.py index a8861c6..75ac5b6 100644 --- a/examples/plot_OTDA_color_images.py +++ b/examples/plot_OTDA_color_images.py @@ -48,6 +48,7 @@ def mat2im(X, shape): """Converts back a matrix to an image""" return X.reshape(shape) + X1 = im2mat(I1) X2 = im2mat(I2) @@ -102,6 +103,7 @@ X2te = da_entrop.predict(X2, -1) def minmax(I): return np.clip(I, 0, 1) + I1t = minmax(mat2im(X1t, I1.shape)) I2t = minmax(mat2im(X2t, I2.shape)) diff --git a/examples/plot_OTDA_mapping_color_images.py b/examples/plot_OTDA_mapping_color_images.py index 85c4b6b..9710461 100644 --- a/examples/plot_OTDA_mapping_color_images.py +++ b/examples/plot_OTDA_mapping_color_images.py @@ -48,6 +48,7 @@ def mat2im(X, shape): """Converts back a matrix to an image""" return X.reshape(shape) + X1 = im2mat(I1) X2 = im2mat(I2) @@ -85,6 +86,7 @@ pl.tight_layout() def minmax(I): return np.clip(I, 0, 1) + # LP problem da_emd = ot.da.OTDA() # init class da_emd.fit(xs, xt) # fit distributions diff --git a/examples/plot_optim_OTreg.py b/examples/plot_optim_OTreg.py index e38253c..276b250 100644 --- a/examples/plot_optim_OTreg.py +++ b/examples/plot_optim_OTreg.py @@ -44,6 +44,7 @@ def f(G): def df(G): return G + reg = 1e-1 Gl2 = ot.optim.cg(a, b, M, reg, f, df, verbose=True) @@ -61,6 +62,7 @@ def f(G): def df(G): return np.log(G) + 1. + reg = 1e-3 Ge = ot.optim.cg(a, b, M, reg, f, df, verbose=True) @@ -78,6 +80,7 @@ def f(G): def df(G): return G + reg1 = 1e-3 reg2 = 1e-1 |