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 #if !defined(ALIZE_UnsupervisedTools_h)
00056 #define ALIZE_UnsupervisedTools_h
00057
00058 #if defined(_WIN32)
00059 #if defined(LIA_SPKTOOLS_EXPORTS)
00060 #define LIA_SPKTOOLS_API __declspec(dllexport)
00061 #else
00062 #define LIA_SPKTOOLS_API __declspec(dllimport)
00063 #endif
00064 #else
00065 #define LIA_SPKTOOLS_API
00066 #endif
00067
00068 #include <alize.h>
00069 #include "liatools.h"
00070
00071 using namespace alize;
00072 using namespace std;
00073
00074
00075
00076
00077 LIA_SPKTOOLS_API void accumulateStatLK(StatServer & ss, FeatureServer & fs, MixtureStat & acc, unsigned long idxBeginFrame, unsigned long nbFrames, Config & config);
00078 LIA_SPKTOOLS_API void accumulateStatLK(StatServer & ss, FeatureServer & fs, MixtureStat & acc, Seg * seg, Config & config);
00079 LIA_SPKTOOLS_API void accumulateStatLK(StatServer & ss, FeatureServer & fs, MixtureStat & acc, SegCluster & selectedSegments, Config & config);
00080
00081
00082
00083
00084
00085
00086
00087 LIA_SPKTOOLS_API void adaptModelEM(Config& config,StatServer &ss,MixtureServer &ms,FeatureServer &fs,SegCluster& selectedSegments,MixtureGD &world,MixtureGD &clientMixture);
00088 LIA_SPKTOOLS_API void adaptModelEM(Config& config,StatServer &ss,MixtureServer &ms,FeatureServer &fs,SegCluster& selectedSegments,FeatureServer &fs2,SegCluster& selectedSegments2,MixtureGD &aprioriModel,MixtureGD &clientMixture,MAPCfg &mapCfg);
00089 LIA_SPKTOOLS_API void adaptModelEM(Config& config,StatServer &ss,MixtureServer &ms,FeatureServer &fs,SegCluster& selectedSegments,FeatureServer &fs2,SegCluster& selectedSegments2,
00090 MixtureGD &aprioriModel,MixtureGD &clientMixture);
00091 LIA_SPKTOOLS_API void adaptModelMAP(Config& config,StatServer &ss,MixtureServer &ms,MixtureGD &world,MixtureGD &clientMixture, unsigned long &frameCount);
00092 LIA_SPKTOOLS_API void adaptModelMAP(Config & config, StatServer & ss, MixtureServer & ms, MixtureGD & aprioriModel, MixtureGD & clientMixture, MAPCfg & mapCfg, unsigned long &frameCount);
00093
00094
00095 LIA_SPKTOOLS_API void modelBasedadaptModel(Config& config,StatServer &ss,MixtureServer &ms,FeatureServer &fs,SegCluster& selectedSegments,
00096 MixtureGD &aprioriModel,MixtureGD &clientMixture, MixtureGD &initModel);
00097 LIA_SPKTOOLS_API void modelBasedadaptModelEM(Config& config,StatServer &ss,MixtureServer &ms,FeatureServer &fs,SegCluster& selectedSegments,
00098 MixtureGD &aprioriModel,MixtureGD &clientMixture, MixtureGD &initModel);
00099 LIA_SPKTOOLS_API void modelBasedadaptModelEM(Config& config,StatServer &ss,MixtureServer &ms,FeatureServer &fs,SegCluster& selectedSegments,FeatureServer &fsTests,SegCluster& selectedSegmentsTests,MixtureGD &aprioriModel,MixtureGD &clientMixture, MixtureGD &initModel);
00100 LIA_SPKTOOLS_API void adaptModel(Config& config,StatServer &ss,MixtureServer &ms,ObjectRefVector &FeatServ,ObjectRefVector & ClusterSeg,
00101 MixtureGD &aprioriModel,MixtureGD &clientMixture,DoubleVector &decision);
00102
00103
00104
00105
00106
00107
00108 LIA_SPKTOOLS_API double computeLLR(StatServer & ss, FeatureServer & fsTests, MixtureGD & world,
00109 MixtureGD & clientMixture, SegCluster & selectedSegmentsTests);
00110
00111 LIA_SPKTOOLS_API double computeLLR(Config & config, StatServer & ss, FeatureServer & fsTests, MixtureGD & world, MixtureGD & clientMixture,
00112 SegCluster & selectedSegmentsTests, String & idTest);
00113
00114 LIA_SPKTOOLS_API double computeFastLLR(StatServer & ss, FeatureServer & fsTests, MixtureGD & world, MixtureGD & clientMixture, SegCluster & selectedSegmentsTests,
00115 String & idTest, Config & config);
00116
00117 LIA_SPKTOOLS_API double computeLLRGD(Config & config, MixtureGD & clientMixture, MixtureGD & world, MixtureGD & dataTest);
00118
00119
00120
00121
00122 LIA_SPKTOOLS_API void expandLLR(DoubleVector & decision, Config & configTest);
00123
00124 LIA_SPKTOOLS_API void WMAP(DoubleVector & decision, Config & configTest);
00125
00126 LIA_SPKTOOLS_API void WMAPGMM(DoubleVector & decision, Config & configTest, MixtureGD & tar, MixtureGD & non, StatServer & ss);
00127 LIA_SPKTOOLS_API void WMAPGMMFixedPriors(DoubleVector & decision, Config & configTest, MixtureGD & tar,
00128 MixtureGD & non, StatServer & ss);
00129 LIA_SPKTOOLS_API String getFullFileName(String & id, Config & c);
00130 LIA_SPKTOOLS_API String getFullMixtureName(String & id, Config & c);
00131 LIA_SPKTOOLS_API bool FileExists(String & fullFileName);
00132
00133
00134
00135
00136 LIA_SPKTOOLS_API void computeMAPmodelFromEMones(Config & config, StatServer & ss, MixtureServer & ms, DoubleVector & nbFramesSelected,
00137 MixtureGD & aprioriModel, MixtureGD & clientMixture, MixtureGD & aux, MixtureGD & tmp, DoubleVector & decision, XLine & testsToCompute);
00138
00139 LIA_SPKTOOLS_API double SegClusterFrame(SegCluster & SegC);
00140
00141 LIA_SPKTOOLS_API void addLineInXList(XLine &line,XList &list);
00142
00143 LIA_SPKTOOLS_API void computePriors(DoubleVector & decision, DoubleVector &priorImp, DoubleVector &priorTar,Config & configTest);
00144
00145
00146
00147
00148
00149
00150 LIA_SPKTOOLS_API void loadTnormParam(String &inputClientListFileName,String &testFile,ObjectRefVector &stockTnorm,Config &config);
00151
00152
00153
00154
00155 LIA_SPKTOOLS_API void computeAndStoreZnormParam(StatServer &ss, String & inputImpListFileName, String &idclient, MixtureGD &clientMixture,
00156 ObjectRefVector & stockZnorm, MixtureGD &world, Config & config, bool &ztnorm, ObjectRefVector & stockTnorm);
00157
00158
00159 LIA_SPKTOOLS_API void learnMAPimpostorModels(Config & config, DoubleVector &NbFramesSelectedImp,MixtureServer &ms,StatServer &ss,MixtureGD &world);
00160
00161
00162
00163 LIA_SPKTOOLS_API void normalizeScore(String &test, double &decision, ObjectRefVector &stockNorm);
00164 LIA_SPKTOOLS_API void normalizeScore(String &test, double &decision, ObjectRefVector &stockNorm, double &shift);
00165
00166
00167 LIA_SPKTOOLS_API void resetWeights(DoubleVector & decision);
00168 LIA_SPKTOOLS_API void Oracle(String &idTar, String & idTest, double &score, Config & config,MixtureGD & tar,
00169 MixtureGD & non, StatServer & ss);
00170
00171
00172
00173 LIA_SPKTOOLS_API void crossValid(Config & configTest, StatServer & ss, MixtureServer & ms, FeatureServer & fs, SegCluster & totalSegments,
00174 MixtureGD & aprioriModel,MixtureGD & bestModel,SegCluster & selectedSegments,String & idTest);
00175
00176
00177 LIA_SPKTOOLS_API double searchLLRFromResFile(String &idTar, String &test ,String &inputResFilename, Config & config);
00178
00179
00180 LIA_SPKTOOLS_API unsigned long adaptModelEMweightedFrames(String &labelSelectedFrames,XLine & featureFileName,StatServer &ss,MixtureGD &world, MixtureGD &tar, MixtureGD &non,MixtureGD &MixtureforLLR,MixtureGD &MixtureEMOutput, Config &config, FeatureServer &fs, String &fullFileName,String &idTest);
00181
00182
00183 LIA_SPKTOOLS_API String selectNearestTarModel(String &TARListFilename, String & fullFileName,Config &config, StatServer & ss, FeatureServer & fs,
00184 MixtureGD & world, SegCluster & selectedSegments,MixtureServer &ms);
00185
00186
00187
00188 LIA_SPKTOOLS_API void computeLLRmatrix(DoubleMatrix &LLR, XLine &models, XList &features, Config &config, StatServer &ss, MixtureGD & world, MixtureServer &ms,String &labelSelectedFrames);
00189
00190
00191
00192 LIA_SPKTOOLS_API void fuseMAP(Config & config, StatServer & ss, MixtureServer & ms, MixtureGD & aprioriModel, MixtureGD & clientMixture, MixtureGD & aux,
00193 MixtureGD & tmp, DoubleVector & decision, XLine & testsToCompute);
00194
00195 LIA_SPKTOOLS_API void fuseMAPMeans(const MixtureGD & model1,double &w1,const MixtureGD & model2,double &w2,MixtureGD &result);
00196
00197
00198 LIA_SPKTOOLS_API double computeWeightedLLR(Config & config, StatServer & ss, FeatureServer &fsTests, MixtureServer & ms, MixtureGD & aprioriModel, SegCluster & selectedSegmentsTests,MixtureGD & aux, DoubleVector & decision, XLine & testsToCompute, String &idTest, String &fullfilename);
00199
00200
00201 LIA_SPKTOOLS_API void copyCluster(SegCluster &source, SegCluster &dest);
00202 LIA_SPKTOOLS_API int findClusterInRefvector(ObjectRefVector &SegServ,String & id);
00203
00204
00205
00206
00207
00208 LIA_SPKTOOLS_API void learnEMimpostorModels(Config & config, DoubleVector &NbFramesSelectedImp,MixtureServer &ms,StatServer &ss,MixtureGD &world);
00209
00210 LIA_SPKTOOLS_API double computeAdaptedTnorm(Config & configTest, MixtureServer & ms,StatServer &ss, MixtureGD &world, MixtureGD &auxMixture, MixtureGD &tmpMixture, double &nonorm_score, int &countTests, DoubleVector &decision, DoubleVector &NbFramesSelected, XLine &testsToCompute,
00211 DoubleVector &NbFramesSelectedImp, FeatureServer &fsTests, SegCluster &selectedSegmentsTests, String &idTest);
00212
00213
00214
00215 LIA_SPKTOOLS_API double findNearestLLRInMatrix(Matrix <double> &Mat, unsigned long &index, double &LLR);
00216
00217
00218 LIA_SPKTOOLS_API void assessAdaptation(StatServer &ss,MixtureGD & adaptedMixture ,SegCluster &selectedSegments,
00219 Config &configTest, FeatureServer &fs, MixtureGD &world, DoubleVector &tmp, String &fullFileNameTrain,
00220 int countTests, double &tarScore);
00221
00222
00223 #endif //!defined(ALIZE_UnsupervisedTools_h)