boost::uniform_real<Dtype> random_distribution(
a, caffe_nextafter<Dtype>(b));
Caffe::random_generator_t &generator = Caffe::vsl_stream();
+ boost::variate_generator<Caffe::random_generator_t,
+ boost::uniform_real<Dtype> > variate_generator(
+ generator, random_distribution);
- for(int i = 0; i < n; i += 1) {
- r[i] = random_distribution(generator);
+ for (int i = 0; i < n; ++i) {
+ r[i] = variate_generator();
}
}
boost::normal_distribution<Dtype> > variate_generator(
generator, random_distribution);
- for(int i = 0; i < n; ++i) {
+ for (int i = 0; i < n; ++i) {
r[i] = variate_generator();
}
}
// FIXME check if parameters are handled in the same way ?
boost::bernoulli_distribution<Dtype> random_distribution(p);
Caffe::random_generator_t &generator = Caffe::vsl_stream();
+ boost::variate_generator<Caffe::random_generator_t,
+ boost::bernoulli_distribution<Dtype> > variate_generator(
+ generator, random_distribution);
- for(int i = 0; i < n; i += 1) {
- r[i] = random_distribution(generator);
+ for (int i = 0; i < n; ++i) {
+ r[i] = variate_generator();
}
}