00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #include <iostream>
00056 #include "SpkAdapt.h"
00057 #define MANDATORY true
00058 #define OPTIONAL false
00059 #define ARG_REQUIRED true
00060 #include "liatools.h"
00061
00062 int main(int argc, char *argv[])
00063 {
00064 try
00065 {
00066 ConfigChecker cc;
00067 cc.addIntegerParam("verboseLevel", false, true,
00068 "level of the verbose information 0=no verbose, 1=normal, 2=more");
00069 cc.addStringParam("config", OPTIONAL, ARG_REQUIRED,
00070 "Train config file name ");
00071 cc.addStringParam("configTest", OPTIONAL, ARG_REQUIRED,
00072 "Unsupervised adaptation config file name ");
00073 cc.addStringParam("targetIdList", MANDATORY, ARG_REQUIRED,
00074 "targets list");
00075 cc.addStringParam("inputWorldFilename", MANDATORY, ARG_REQUIRED,
00076 "world model");
00077 cc.addStringParam("testsIdList", MANDATORY, ARG_REQUIRED, "tests list");
00078 cc.addBooleanParam("NISTprotocol", MANDATORY, ARG_REQUIRED,
00079 "true to follow unsupervised NIST protocol, false to follow BATCH protocol");
00080 cc.addBooleanParam("WMAP", false, false,
00081 "NO MORE USED, Choice of WMAP (one Gaussian) to compute trial feature server weights, need other param : MUtarget,MUimp,SIGMAtarget and SIGMAIMP;TAR weight and IMPweight, thrMin and thrMax");
00082 cc.addBooleanParam("WMAPGMM", false, false,
00083 "Choice of WMAP GMM to compute trial feature server weights, param needed : two gmm of scores, TARScoresModel and NONScoresModel. Need also a value for Priors update, initPriorImp (10) and initPriorTar(1) ");
00084 cc.addBooleanParam("TNORM", false, false,
00085 " TNORM scores before computing WMAP, need gmm of Tnormed scores and a param : impScoreFile, score file for TNORM and testsNames, the list of trial segments ");
00086 cc.addBooleanParam("FAST", false, false,
00087 "FAST MODE : For computing LLR use top ten info files AND FOR FUSING EM MODELS WHEN UPDATING");
00088 cc.addBooleanParam("FromResFile", false, false,
00089 " Avoid to compute LLR for WMAP computing, search LLR in a score file, param needed: InputResFilename");
00090 cc.addBooleanParam("CrossValid", false, false,
00091 " compute LLR of a percentage of train data on a model learnt on a percentage of train data AverageIt times and return the best ML (one iter) model, need AverageIt, SelectedTrain.");
00092 cc.addBooleanParam("Oracle", false, false,
00093 " For Oracle (supervised) experiments, need targetTests to perform adaptation on target tests only");
00094 cc.addBooleanParam("REGRESS", false, false,
00095 "Use logistic regression for adaptation weights computing, need BETA and THETA");
00096 cc.addIntegerParam("MaxMixturesCount", false, true,
00097 "max mixtures stored in the mixture server (in memory)");
00098 cc.addIntegerParam("LLKthreshold", false, true,
00099 "thresholds the results of LLR in order to avoid problem in WMAP computing");
00100 cc.addStringParam("computeLLKWithTopDistribs", true, true,
00101 "PARTIAL/COMPLETE: will compute LLK with topdistribs. COMPLETE: add world LLK to client LLK, PARTIAL: just keeps the topDistrib LLK");
00102 cc.addIntegerParam("topDistribsCount ", false, true,
00103 "Number of distrib to approximate complete LLK");
00104 cc.addStringParam("InfoExtension", false, true,
00105 "Extension for top ten info files");
00106 cc.addStringParam("InfoPath", false, true, "Path for top ten info files");
00107 cc.addFloatParam("OptimalScore", false, true,
00108 "Used for updating priors (fixedPriors == false), if LLR is superior add one for target count, else add one for impostors count ");
00109 cc.addBooleanParam("SegMode", MANDATORY, ARG_REQUIRED,
00110 "For adaptation by segments (for the moment support only 3 frame segments)");
00111 cc.addIntegerParam("mixtureDistribCountForGMMScores", false, true,
00112 "NUMBER OF GAUSSIAN IN SCORES GMM");
00113 cc.addBooleanParam("ScoresByTarget", MANDATORY, ARG_REQUIRED," IF SET TO TRUE TWO GMM (TAR AND NON) ARE NEEDED BY CLIENT (idcinet.tar and idclient.non)");
00114 cc.addStringParam("TARListFilename", false, true, "List of the TAR model id (used when ScoresByTarget is set to true)");
00115 cc.addIntegerParam("ResetNbAdapt ", false, true,
00116 "Max number of tests used for adaptation");
00117 Config tmp;
00118 CmdLine cmdLine(argc, argv);
00119 if (cmdLine.displayHelpRequired())
00120 {
00121 cout << "************************************" << endl;
00122 cout << "********** SpkAdapt.exe *********" << endl;
00123 cout << "************************************" << endl;
00124 cout << endl;
00125 cout <<
00126 "Unsupervised adaptation process, update model using test trial information following NIST protocol"
00127 << endl;
00128 cout << "" << endl;
00129 cout << endl;
00130 cout << "Command Line example: " << endl;
00131 cout <<
00132 "SpkAdapt.exe --config cfg/TrainTarget.cfg --configTest cfg/TrainTest.cfg --inputWorldFilename world --targetIdList ./lst/id.lst --testsIdList ./lst/tests.list --outputLLRFilename file --NISTprotocol true"
00133 << endl;
00134 cout << cc.getParamList() << endl;
00135 }
00136 else
00137 {
00138 cmdLine.copyIntoConfig(tmp);
00139 Config config(tmp.getParam("config"));
00140 cmdLine.copyIntoConfig(config);
00141 Config configTest(tmp.getParam("configTest"));
00142 if (config.existsParam("verbose"))
00143 verbose = config.getParam("verbose").toBool();
00144 else
00145 verbose = false;
00146 bool segmode=false;
00147 if (config.existsParam("SegMode"))
00148 segmode = config.getParam("SegMode").toBool();
00149 if (verbose)
00150 verboseLevel = 1;
00151 else
00152 verboseLevel = 0;
00153 if (config.existsParam("verboseLevel"))
00154 verboseLevel = config.getParam("verboseLevel").toLong();
00155 if (verboseLevel > 0)
00156 verbose = true;
00157
00158 TrainTargetAdapt(config, configTest);
00159
00160 }
00161 }
00162 catch(alize::Exception & e)
00163 {
00164 cout << e.toString() << endl;
00165 }
00166
00167 return 0;
00168 }