ex-6: fix EMD typo
This commit is contained in:
parent
3119e18451
commit
1ccf3759c5
@ -10,7 +10,7 @@
|
|||||||
* equally sized this can be futher simplified to give a simple
|
* equally sized this can be futher simplified to give a simple
|
||||||
* O(n) solution.
|
* O(n) solution.
|
||||||
*/
|
*/
|
||||||
double edm_between(gsl_histogram *a, gsl_histogram *b) {
|
double emd_between(gsl_histogram *a, gsl_histogram *b) {
|
||||||
/* For the distance to make sense the
|
/* For the distance to make sense the
|
||||||
* histograms must have the same area.
|
* histograms must have the same area.
|
||||||
*/
|
*/
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* equally sized this can be futher simplified to give a simple
|
* equally sized this can be futher simplified to give a simple
|
||||||
* O(n) solution.
|
* O(n) solution.
|
||||||
*/
|
*/
|
||||||
double edm_between(gsl_histogram *a, gsl_histogram *b);
|
double emd_between(gsl_histogram *a, gsl_histogram *b);
|
||||||
|
|
||||||
|
|
||||||
/* Normalise a histogram: ie rescaling the bin
|
/* Normalise a histogram: ie rescaling the bin
|
||||||
|
@ -9,7 +9,7 @@ def plot(table, title='', log=False):
|
|||||||
plt.subplot(211)
|
plt.subplot(211)
|
||||||
if log:
|
if log:
|
||||||
plt.xscale('log')
|
plt.xscale('log')
|
||||||
plt.title('EDM distance' + ' '*10, loc='right')
|
plt.title('EMD distance' + ' '*10, loc='right')
|
||||||
|
|
||||||
plt.plot(table[0], table[1], color='#92182b')
|
plt.plot(table[0], table[1], color='#92182b')
|
||||||
plt.tick_params(axis='y', labelcolor='#92182b')
|
plt.tick_params(axis='y', labelcolor='#92182b')
|
||||||
@ -31,7 +31,7 @@ def plot(table, title='', log=False):
|
|||||||
|
|
||||||
|
|
||||||
plt.rcParams['font.size'] = 12
|
plt.rcParams['font.size'] = 12
|
||||||
table = np.loadtxt('ex-6/plots/edm-round.txt')
|
table = np.loadtxt('ex-6/plots/emd-round.txt')
|
||||||
|
|
||||||
plot(table[:27].T, title='noiseless', log=True)
|
plot(table[:27].T, title='noiseless', log=True)
|
||||||
plot(table[27:47].T, title=r'$\sigma=0.005$')
|
plot(table[27:47].T, title=r'$\sigma=0.005$')
|
@ -104,8 +104,8 @@ pair_t experiment(
|
|||||||
* distance histogram.
|
* distance histogram.
|
||||||
*/
|
*/
|
||||||
pair_t dist;
|
pair_t dist;
|
||||||
dist.a = edm_between(hist, fft_clean);
|
dist.a = emd_between(hist, fft_clean);
|
||||||
dist.b = edm_between(hist, rl_clean);
|
dist.b = emd_between(hist, rl_clean);
|
||||||
|
|
||||||
// free memory
|
// free memory
|
||||||
gsl_histogram_free(hist);
|
gsl_histogram_free(hist);
|
||||||
|
Loading…
Reference in New Issue
Block a user