From 192c6b8cafc2b44640c0870cbfb4c616bdb95bde Mon Sep 17 00:00:00 2001 From: Manos Katsomallos Date: Wed, 6 Oct 2021 18:25:08 +0200 Subject: [PATCH] expt: Trying Wasserstein --- code/expt/copenhagen-sel.py | 2 +- code/expt/hue-sel.py | 2 +- code/expt/t-drive-sel.py | 2 +- code/lib/lmdk_sel.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/expt/copenhagen-sel.py b/code/expt/copenhagen-sel.py index 321b48f..cd69c7b 100644 --- a/code/expt/copenhagen-sel.py +++ b/code/expt/copenhagen-sel.py @@ -144,7 +144,7 @@ def main(args): # # Show plot # plt.show() # Save plot - lmdk_lib.save_plot(path + '-sel.pdf') + lmdk_lib.save_plot(path + '-sel-emd.pdf') print('[OK]', flush=True) diff --git a/code/expt/hue-sel.py b/code/expt/hue-sel.py index bb70f83..70d15e9 100644 --- a/code/expt/hue-sel.py +++ b/code/expt/hue-sel.py @@ -134,7 +134,7 @@ def main(args): # Show plot # plt.show() # Save plot - lmdk_lib.save_plot(path + '-sel.pdf') + lmdk_lib.save_plot(path + '-sel-emd.pdf') print('[OK]', flush=True) diff --git a/code/expt/t-drive-sel.py b/code/expt/t-drive-sel.py index 1f1683c..ce41560 100644 --- a/code/expt/t-drive-sel.py +++ b/code/expt/t-drive-sel.py @@ -155,7 +155,7 @@ def main(args): # Show plot # plt.show() # Save plot - lmdk_lib.save_plot(path + '-sel.pdf') + lmdk_lib.save_plot(path + '-sel-emd.pdf') print('[OK]', flush=True) diff --git a/code/lib/lmdk_sel.py b/code/lib/lmdk_sel.py index b45a79d..cdbef0f 100644 --- a/code/lib/lmdk_sel.py +++ b/code/lib/lmdk_sel.py @@ -175,8 +175,8 @@ def get_opts_from_top_h(seq, lmdks): hist_tmp = np.copy(hist_cur) hist_tmp[i] += 1 # Find difference from original - diff_cur = get_norm(hist, hist_tmp) # Euclidean - # diff_cur = get_emd(hist, hist_tmp) # Wasserstein + # diff_cur = get_norm(hist, hist_tmp) # Euclidean + diff_cur = get_emd(hist, hist_tmp) # Wasserstein # Remember if it is the best that you've seen if diff_cur < diff_min: diff_min = diff_cur