summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-05-16 14:29:21 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2011-05-16 14:29:21 -0400
commitf55c7687a5998cdc05ff63134cd1fb398bc8ce24 (patch)
treefdc9f7cf13e674505d48af50988f9e112959ef2d
parent581d3e710df344943302176685cf1129b16a65ac (diff)
proper sampling from unit sphere
-rw-r--r--vest/line_optimizer.cc2
1 files changed, 1 insertions, 1 deletions
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<int>& features_to_optimize,
RandomNumberGenerator<boost::mt19937>* 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();
}