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
commit19520aa3f1018ce1a1b55303df9e7c291f0c4d80 (patch)
tree0816efc4ae57fbace995431be00325f77f42b693
parentfbaaeb9e9293b5cb299fa92649b6cc5ff882d9d6 (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();
}