Definition at line 103 of file mainTrainModel.cpp. References Impala::CmdOptions::AddOption(), Impala::CmdOptions::GetInstance(), ILOG_ERROR_COUNT, ILOG_VAR, Impala::CmdOptions::Initialise(), Impala::CmdOptions::ParseArgs(), Impala::Core::Vector::ReduceSum(), and TrainModel(). Referenced by main(). 00104 { 00105 ILOG_VAR(Impala.Application.mainTrainModel); 00106 Link::Mpi::Init(&argc, &argv); 00107 CmdOptions& options = CmdOptions::GetInstance(); 00108 options.Initialise(false, false, true); 00109 options.AddOption(0, "assume-shotid", "bool", "0"); 00110 options.AddOption('m', "cache", "megabytes", "500"); 00111 options.AddOption(0, "start", "index of concept to start with", "0"); 00112 options.AddOption(0, "number", "number of concepts", "-1"); 00113 options.AddOption(0, "concept", "name", ""); 00114 options.AddOption(0, "kernel", "string: [linear,poly,rbf,sigmoid,precomputed,hist,dist-precomputed]", "rbf"); 00115 options.AddOption(0, "featureIndexCat", "name", ""); 00116 options.AddOption(0, "maxVideoId", "index", "-1"); 00117 options.AddOption(0, "maxPosPerVideo", "number", "-1"); 00118 options.AddOption(0, "maxNegPerVideo", "number", "-1"); 00119 // prevent dataserver from keeping all ImageArchives open 00120 options.AddOption(0, "imCacheSize", "size", "1"); 00121 00122 if (options.ParseArgs(argc, argv, "dataSet concepts model featureDef", 4)) 00123 { 00124 Training::Factory factory(&options, true); 00125 /* when we use a distributed kernel matix we assume that node 0 does 00126 computation while other nodes load the distributed kernel matrix */ 00127 bool dist = (options.GetString("kernel") == "dist-precomputed"); 00128 if (dist && Link::Mpi::MyId() != 0) 00129 { 00130 factory.ServeDistributedAccess(); 00131 } 00132 else 00133 { 00134 // make sure we subscribe, even if we are skipping all concepts; 00135 // otherwise the program will hang 00136 if (options.GetString("kernel") == "dist-precomputed") 00137 factory.GetDistributedAccess(); 00138 TrainModel(&factory, dist); 00139 } 00140 } 00141 00142 int nrOfErrors = ILOG_ERROR_COUNT; 00143 nrOfErrors = Link::Mpi::ReduceSum(nrOfErrors); 00144 ILOG_INFO_HEADNODE("Root: total nr error = " << nrOfErrors); 00145 Link::Mpi::Finalize(); 00146 return nrOfErrors; 00147 }
Here is the call graph for this function: ![]()
|