Definition at line 153 of file mainRandomForest.cpp. References Impala::Core::Feature::DeleteForest(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Core::Feature::GetCodebookLength(), ILOG_ERROR, ILOG_FUNCTION, main(), Impala::Core::Feature::ReadRandomForest(), and Impala::Core::Table::Table::Size(). Referenced by RandomForest(). 00155 { 00156 ILOG_FUNCTION(main); 00157 int codebookLength = GetCodebookLength(codebook); 00158 int* hist = new int[codebookLength]; 00159 for(int i=0 ; i<codebookLength ; ++i) 00160 hist[i] = 0; 00161 Feature::RandomForest forest = ReadRandomForest(codebook); 00162 for(int i=0; i<featureSampling.Size(); ++i) 00163 { 00164 for(int f=0; f<forest.size(); ++f) 00165 { 00166 Feature::RandomTree* tree = forest[f]; 00167 int codeword = tree->GetCodeWord(featureSampling.Get1(i)); 00168 ++hist[codeword]; 00169 } 00170 } 00171 DeleteForest(forest); 00172 std::ofstream ofs("projectiondump.txt"); 00173 if(ofs.is_open()) 00174 { 00175 for(int i=0 ; i<codebookLength ; ++i) 00176 ofs << i <<": #"<< hist[i] <<"\n"; 00177 ofs.close(); 00178 } 00179 else 00180 ILOG_ERROR("couldn't dump projection"); 00181 delete hist; 00182 }
Here is the call graph for this function:
|