Definition at line 88 of file mainCrossValidate.cpp. References Impala::CmdOptions::AddOption(), CrossValidate(), Impala::CmdOptions::GetInstance(), ILOG_ERROR_COUNT, ILOG_VAR, Impala::CmdOptions::Initialise(), Impala::CmdOptions::ParseArgs(), and Impala::Core::Vector::ReduceSum(). Referenced by main(). 00089 { 00090 ILOG_VAR(Impala.Application.mainCrossValidate); 00091 Link::Mpi::Init(&argc, &argv); 00092 CmdOptions& options = CmdOptions::GetInstance(); 00093 options.Initialise(false, false, true); 00094 options.AddOption(0, "start", "index of concept to start with", "0"); 00095 options.AddOption(0, "number", "number of concepts", "-1"); 00096 options.AddOption(0, "concept", "name", ""); 00097 options.AddOption(0, "w1", "number or range", "[log-3:3/10]"); 00098 options.AddOption(0, "w2", "number or range", "[log-3:3/10]"); 00099 options.AddOption(0, "autoweight", "bool", "0"); 00100 options.AddOption(0, "C", "number or range", "1"); 00101 options.AddOption(0, "gamma", "number or range (-1 for 1/feat length)", "-1"); 00102 options.AddOption('r', "repetitions", "number", "2"); 00103 options.AddOption(0, "episode-constrained", "bool", "1"); 00104 options.AddOption(0, "assume-shotid", "bool", "0"); 00105 options.AddOption 00106 (0, "evaluator", 00107 "choose from {AP, BAP, AUC, P@N, R@N} where N is number (precision @ n)", 00108 "AP"); 00109 options.AddOption('f', "folds", "number", "3"); 00110 options.AddOption('m', "cache", "megabytes", "500"); 00111 options.AddOption('p', "probability", "bool", "0"); 00112 options.AddOption 00113 (0, "kernel", 00114 "string: [linear,poly,rbf,sigmoid,precomputed,hist,dist-precomputed]", 00115 "rbf"); 00116 options.AddOption(0, "precompute-kernel", "string: [chi2]", "chi2"); 00117 options.AddOption(0, "featureIndexCat", "name", ""); 00118 options.AddOption(0, "maxVideoId", "index", "-1"); 00119 options.AddOption(0, "maxPosPerVideo", "number", "-1"); 00120 options.AddOption(0, "maxNegPerVideo", "number", "-1"); 00121 options.AddOption(0, "restrictTestFoldSet", "setId", "-1"); 00122 options.AddOption(0, "dumpFolds", "", "0"); 00123 options.AddOption(0, "testMode", "", "0"); 00124 // prevent dataserver from keeping all ImageArchives open 00125 options.AddOption(0, "imCacheSize", "size", "1"); 00126 00127 if (options.ParseArgs(argc, argv, "dataSet concepts model featureDef", 4)) 00128 { 00129 Training::Factory factory(&options, true); 00130 // when we use a distributed kernel matix we assume that node 0 does 00131 // computation while other nodes load the distributed kernel matrix 00132 String kernel = options.GetString("kernel"); 00133 ILOG_INFO_HEADNODE("kernel = " << kernel); 00134 if ((kernel == "dist-precomputed") && (Link::Mpi::MyId() != 0)) 00135 { 00136 factory.ServeDistributedAccess(); 00137 } 00138 else 00139 { 00140 // make sure we subscribe, even if we are skipping all concepts; 00141 // otherwise the program will hang 00142 if (kernel == "dist-precomputed") 00143 factory.GetDistributedAccess(); 00144 bool testMode = options.GetBool("testMode"); 00145 CrossValidate(&factory, testMode); 00146 } 00147 } 00148 00149 int nrOfErrors = ILOG_ERROR_COUNT; 00150 nrOfErrors = Link::Mpi::ReduceSum(nrOfErrors); 00151 ILOG_INFO_HEADNODE("Root: total nr error = " << nrOfErrors); 00152 Link::Mpi::Finalize(); 00153 return nrOfErrors; 00154 }
Here is the call graph for this function: ![]()
|