# HG changeset patch # User mas01cr # Date 1213617445 0 # Node ID dcbb30790b3048225ea88bc418eccb87bfa809df # Parent 30a2a45f2b70f84c6b2c826ed71f4dc55e377eb1 Whoops. Fix EXTREMELY EMBARRASSING bug in distance computation. diff -r 30a2a45f2b70 -r dcbb30790b30 sample.cpp --- a/sample.cpp Mon Jun 16 11:15:15 2008 +0000 +++ b/sample.cpp Mon Jun 16 11:57:25 2008 +0000 @@ -127,7 +127,7 @@ /* assume normalizedDistance == true for now */ /* FIXME: not convinced that the statistics we calculated in TASLP paper are valid for normalizedDistance */ - double dist = 2 - v1v2 / sqrt(v1norm * v2norm); + double dist = 2 - 2 * v1v2 / sqrt(v1norm * v2norm); VERB_LOG(1, "%f %f\n", dist, log(dist)); sumdist += dist; sumlogdist += log(dist);