diff options
author | Antoine Rolet <antoine.rolet@gmail.com> | 2017-09-05 15:30:50 +0900 |
---|---|---|
committer | Antoine Rolet <antoine.rolet@gmail.com> | 2017-09-05 15:30:50 +0900 |
commit | 13dfb3ddbbd8926b4751b82dd41c5570253b1f07 (patch) | |
tree | b28098e98640c64483a599103e2fdb5df46d2c79 /test/test_emd_multi.py | |
parent | 185eb3e2ef34b5ce6b8f90a28a5bcc78432b7fd3 (diff) | |
parent | 16697047eff9326a0ecb483317c13a854a3d3a71 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'test/test_emd_multi.py')
-rw-r--r-- | test/test_emd_multi.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/test/test_emd_multi.py b/test/test_emd_multi.py deleted file mode 100644 index ee0a20e..0000000 --- a/test/test_emd_multi.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- -""" -Created on Fri Mar 10 09:56:06 2017 - -@author: rflamary -""" - -import numpy as np -import pylab as pl -import ot - -from ot.datasets import get_1D_gauss as gauss -reload(ot.lp) - -#%% parameters - -n=5000 # nb bins - -# bin positions -x=np.arange(n,dtype=np.float64) - -# Gaussian distributions -a=gauss(n,m=20,s=5) # m= mean, s= std - -ls= range(20,1000,10) -nb=len(ls) -b=np.zeros((n,nb)) -for i in range(nb): - b[:,i]=gauss(n,m=ls[i],s=10) - -# loss matrix -M=ot.dist(x.reshape((n,1)),x.reshape((n,1))) -#M/=M.max() - -#%% - -print('Computing {} EMD '.format(nb)) - -# emd loss 1 proc -ot.tic() -emd_loss4=ot.emd2(a,b,M,1) -ot.toc('1 proc : {} s') - -# emd loss multipro proc -ot.tic() -emd_loss4=ot.emd2(a,b,M) -ot.toc('multi proc : {} s') |