void
 generateMT
 (
     int stripe
 )
 {
     // Randomly estimate the best pair of sub-patches
     boost::mt19937 rng(abs(stripe+1) * std::time(NULL));
     if (Sample::generateSplit(m_samples, &rng, m_patch_size, m_splits[stripe]))
     {
         // Process each patch with the selected R1 and R2
         std::vector<IntIndex> val_set(m_samples.size());
         for (unsigned int i=0; i < m_samples.size(); ++i)
         {
             val_set[i].first  = m_samples[i]->evalTest(m_splits[stripe]);
             val_set[i].second = i;
         }
         std::sort(val_set.begin(), val_set.end()); // sort by f_theta
         findThreshold(m_samples, val_set, m_splits[stripe], &rng);
         m_splits[stripe].oob = 0;
     }
     else
     {
         m_splits[stripe].threshold = 0;
         m_splits[stripe].info = boost::numeric::bounds<double>::lowest();
         m_splits[stripe].oob  = boost::numeric::bounds<double>::highest();
     }
 };
Ejemplo n.º 2
0
  void generate_mt(int stripe) {
    boost::mt19937 rng_thread(abs(stripe + 1) * std::time(NULL));

    if (Sample::generateSplit(data, &rng_thread, fp, splits[stripe], split_mode, depth)) {
      std::vector<IntIndex> valSet(data.size());
      for (unsigned int l = 0; l < data.size(); ++l) {
        valSet[l].first = data[l]->evalTest(splits[stripe]);
        valSet[l].second = l;
      }
      std::sort(valSet.begin(), valSet.end());
      findThreshold(data, valSet, splits[stripe], &rng_thread);
      splits[stripe].oob = 0;
    } else {
      splits[stripe].threshold = 0;
      splits[stripe].info = boost::numeric::bounds<double>::lowest();
      splits[stripe].gain = boost::numeric::bounds<double>::lowest();
      splits[stripe].oob = boost::numeric::bounds<double>::highest();
    }
  }