main.cpp
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003
00004 #include <fstream>
00005 #include <string.h>
00006 #include <string>
00007 #include <math.h>
00008 #include <vector>
00009 #include <deque>
00010
00011 #include "config.h"
00012 #include "Data.h"
00013 #include "Scheduler.h"
00014 #include "StreamOutput.h"
00015 #include "AlgorithmExploration.h"
00016 #include "NumericalTools.h"
00017
00090 using namespace std;
00091
00092 StreamOutput cout;
00093
00094 int main ( int argc, char *argv[] )
00095 {
00096
00097 if ( argc <= 1 )
00098 {
00099 cout<<"1) Please supply at least one argument [e] for algorithm exploration"<<endl;
00100 cout<<"2) Please supply a dataset directory and [t,p,b,x,y] for training, prediction, blending, bagging or boosting"<<endl;
00101 cout<<" Example: ./EnsembleLearningFramework MNIST t"<<endl<<endl;
00102 exit ( 0 );
00103 }
00104
00105
00106 Framework::setMaxThreads ( omp_get_max_threads() );
00107
00108
00109
00110 if ( argc == 2 )
00111 if ( argv[1][0] == 'e' || argv[1][0] == 'E' )
00112 {
00113 AlgorithmExploration a;
00114 a.start();
00115 exit ( 0 );
00116 }
00117
00118
00119
00120 if ( argc <= 2 )
00121 {
00122 cout<<"Please supply a dataset directory and [t,p,b,x,y] for training, prediction, blending, bagging or boosting"<<endl;
00123 cout<<"Example: ./EnsembleLearningFramework MNIST t"<<endl<<endl;
00124 exit ( 0 );
00125 }
00126 if ( argc >= 4 )
00127 Framework::setAdditionalStartupParameter ( argv[3] );
00128
00129
00130
00131 Scheduler s;
00132 s.readMasterDscFile ( argv[1], "Master.dsc" );
00133
00134
00135 if ( argv[2][0] == 't' || argv[2][0] == 'T' )
00136 s.train();
00137
00138
00139 if ( argv[2][0] == 'p' || argv[2][0] == 'P' )
00140 s.predict();
00141
00142
00143 if ( argv[2][0] == 'b' || argv[2][0] == 'B' )
00144 s.blend();
00145
00146
00147 if ( argv[2][0] == 'x' || argv[2][0] == 'X' )
00148 s.bagging();
00149
00150
00151 if ( argv[2][0] == 'y' || argv[2][0] == 'Y' )
00152 s.boosting();
00153
00154 return 0;
00155 }