From f55c7687a5998cdc05ff63134cd1fb398bc8ce24 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 16 May 2011 14:29:21 -0400 Subject: proper sampling from unit sphere --- vest/line_optimizer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vest') diff --git a/vest/line_optimizer.cc b/vest/line_optimizer.cc index 70a00cbc..7303df8d 100644 --- a/vest/line_optimizer.cc +++ b/vest/line_optimizer.cc @@ -81,7 +81,7 @@ void LineOptimizer::RandomUnitVector(const vector& features_to_optimize, RandomNumberGenerator* rng) { axis->clear(); for (int i = 0; i < features_to_optimize.size(); ++i) - axis->set_value(features_to_optimize[i], rng->next() - 0.5); + axis->set_value(features_to_optimize[i], rng->NextNormal(0.0,1.0)); (*axis) /= axis->l2norm(); } -- cgit v1.2.3