expt: Trying Wasserstein
This commit is contained in:
		@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user