Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

int Impala::Application::mainCrossValidate ( int  argc,
char **  argv 
)

Definition at line 77 of file mainCrossValidate.cpp.

References Impala::CmdOptions::AddOption(), CrossValidate(), Impala::Core::DataFactory::GetDistributedAccess(), Impala::CmdOptions::GetInstance(), ILOG_VAR, Impala::CmdOptions::Initialise(), main(), Impala::CmdOptions::ParseArgs(), and Impala::Core::DataFactory::ServeDistributedAccess().

Referenced by main().

00078 {
00079     ILOG_VAR(main);
00080     Link::Mpi::Init(&argc, &argv);
00081     int retval = 0;
00082     CmdOptions& options = CmdOptions::GetInstance();
00083     options.Initialise(false, false, true);
00084     options.AddOption(0, "start", "index of concept to start with", "0");
00085     options.AddOption(0, "number", "number of concepts", "-1");
00086     options.AddOption(0, "concept", "name", "");
00087     options.AddOption(0, "w1", "number or range", "[log-3:3/10]");
00088     options.AddOption(0, "w2", "number or range", "[log-3:3/10]");
00089     options.AddOption(0, "autoweight", "bool", "0");
00090     options.AddOption(0, "C", "number or range", "1");
00091     options.AddOption(0, "gamma", "number or range (-1 for 1/feat length)", "-1");
00092     options.AddOption('r', "repetitions", "number", "2");
00093     options.AddOption(0, "episode-constrained", "bool", "1");
00094     options.AddOption(0, "assume-shotid", "bool", "0");
00095     options.AddOption
00096         (0, "evaluator",
00097          "choose from {AP, BAP, AUC, P@N, R@N} where N is number (precision @ n)",
00098          "AP");
00099     options.AddOption('f', "folds", "number", "3");
00100     options.AddOption('m', "cache", "megabytes", "500");
00101     options.AddOption('p', "probability", "bool", "0");
00102     options.AddOption
00103         (0, "kernel",
00104          "string: [linear,poly,rbf,sigmoid,precomputed,hist,dist-precomputed]",
00105          "rbf");
00106     options.AddOption(0, "precompute-kernel", "string: [chi2]", "chi2");
00107     options.AddOption(0, "maxVideoId", "index", "-1");
00108     options.AddOption(0, "maxPosPerVideo", "number", "-1");
00109     options.AddOption(0, "maxNegPerVideo", "number", "-1");
00110     options.AddOption(0, "dumpFolds", "", "0");
00111     // prevent dataserver from keeping all ImageArchives open
00112     options.AddOption(0, "imCacheSize", "size", "1");
00113     if (options.ParseArgs(argc, argv, "dataSet concepts model featureDef", 4))
00114     {
00115         ApplicationFactory factory(&options);
00116         Util::PropertySet* properties = factory.MakeClassifierProperties();
00117         Training::Factory* trainFactory = factory.MakeTrainFactory(properties);
00118         DataFactory* dataFactory = factory.MakeDataFactory();
00119         /* when we use a distributed kernel matix we assume that node 0 does
00120            computation while other nodes load the distributed kernel matrix */
00121         if(options.GetString("kernel") == "dist-precomputed"
00122            && Link::Mpi::MyId() != 0)
00123         {
00124             dataFactory->ServeDistributedAccess();
00125         }
00126         else
00127         {
00128             // make sure we subscribe, even if we are skipping all concepts;
00129             // otherwise the program will hang
00130             if(options.GetString("kernel") == "dist-precomputed") 
00131                 dataFactory->GetDistributedAccess();
00132             std::cout <<"id: "<< Link::Mpi::MyId() << " ,kernel = "<<
00133                 options.GetString("kernel") << std::endl; 
00134             CrossValidate(properties, trainFactory, dataFactory);
00135         }
00136         ILOG_DEBUG_ONCE("deleting dataFactory");
00137         delete dataFactory;
00138         ILOG_DEBUG_ONCE("deleting trainFactory");
00139         delete trainFactory;
00140         ILOG_DEBUG_ONCE("deleting properties");
00141         delete properties;
00142     }
00143 
00144     Link::Mpi::Finalize();
00145     return retval;
00146 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:36:23 2010 for ImpalaSrc by  doxygen 1.5.1