Input one or two feature tables and out comes the kernel distance matrix. If there are two tables then the first is the devel set and the seccond is the test set. The testset always makes up the rows of the matrix while the devel set makes up the columns of the matrix. So variable horizontal (which stores the part of the develfeatures) loops over the columns. please note that the function parameters row and column specify the place of this node in the partcount x partcount 'grid' of nodes. So therefore horizontal = GetPartial(f1, column, partcount);
Definition at line 309 of file mainPrecomputeKernelMatrix.cpp. References Impala::Core::Vector::Apply(), CheckQuids(), Impala::Core::Training::Chi2Distance(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::GetColumn2(), GetPartial(), GetPartialTask(), ILOG_VAR, Impala::Core::Vector::VectorSet< ArrayT >::SetSize(), and Impala::Core::Table::Table::Size(). Referenced by mainPrecomputeKernelMatrix(). 00312 { 00313 ILOG_VAR(Application.mainPrecomputeKernelMatrix.ComputeMatrix); 00314 int partcount, row, column; 00315 GetPartialTask(partcount, row, column); 00316 if(partcount == 0) 00317 ILOG_ERROR_NODE("partcount == 0: shouldn't reach this point in code"); 00318 Feature::FeatureTable* horizontal; 00319 Feature::FeatureTable* vertical; 00320 if(partcount == 1) 00321 { 00322 horizontal = devel; 00323 vertical = test; 00324 } 00325 else 00326 { 00327 horizontal = GetPartial(devel, column, partcount); 00328 vertical = GetPartial(test, row, partcount); 00329 delete devel; 00330 if(test != devel) 00331 delete test; 00332 } 00333 if(column == 0) 00334 CheckQuids(vertical, set, set2, resultname + ".rowindices", row, partcount); 00335 if(row == 0) 00336 CheckQuids(horizontal, set, set2, resultname + ".columnindices", column, partcount); 00337 00338 00339 // fill a matrix with chi2 distance 00340 typedef Feature::FeatureTable::ColumnVectorSet VectorSet; 00341 VectorSet* vectorsH = horizontal->GetColumn2(); 00342 VectorSet* vectorsV = vertical->GetColumn2(); 00343 vectorsH->SetSize(horizontal->Size()); 00344 vectorsV->SetSize(vertical->Size()); 00345 Matrix::Mat* distanceMatrix = Apply(&Training::Chi2Distance, vectorsH, vectorsV); 00346 delete horizontal; 00347 if(horizontal != vertical) 00348 delete vertical; 00349 return distanceMatrix; 00350 }
Here is the call graph for this function:
|