diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-05-16 14:29:21 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-05-16 14:29:21 -0400 |
commit | 19520aa3f1018ce1a1b55303df9e7c291f0c4d80 (patch) | |
tree | 0816efc4ae57fbace995431be00325f77f42b693 | |
parent | fbaaeb9e9293b5cb299fa92649b6cc5ff882d9d6 (diff) |
proper sampling from unit sphere
-rw-r--r-- | vest/line_optimizer.cc | 2 |
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(); } |