本文整理汇总了C++中XList::addLine方法的典型用法代码示例。如果您正苦于以下问题:C++ XList::addLine方法的具体用法?C++ XList::addLine怎么用?C++ XList::addLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XList
的用法示例。
在下文中一共展示了XList::addLine方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
FactorAnalysisStat::FactorAnalysisStat(String & featFilename,FeatureServer & fs,Config & config):_ms(config),_ss(config){ // constructor for a single file
XList faNdx;
XLine featLine;
featLine.addElement(featFilename);
faNdx.addLine()=featLine;
_init(faNdx,fs,config);
}
示例2: IvExtractorEigenDecomposition
//-----------------------------------------------------------------------------------------------------------------------------------------------------------
int IvExtractorEigenDecomposition(Config& config)
{
String inputWorldFilename = config.getParam("inputWorldFilename");
// label for selected frames - Only the frames associated with this label, in the label files, will be used
bool fixedLabelSelectedFrame=true;
String labelSelectedFrames;
if (config.existsParam("useIdForSelectedFrame")) // the ID of each speaker is used as labelSelectedFrame ?
fixedLabelSelectedFrame=(config.getParam("useIdForSelectedFrame").toBool()==false);
if (fixedLabelSelectedFrame) // the label is decided by the command line and is unique for the run
labelSelectedFrames=config.getParam("labelSelectedFrames");
try{
MixtureServer ms(config);
if (verbose) cout << "(IvExtractor) Approximate i-vector by using Eigen Decomposition"<<endl;
if (verbose) cout << "(IvExtractor) TotalVariability - Load world model [" << inputWorldFilename<<"]"<<endl;
MixtureGD& world = ms.loadMixtureGD(inputWorldFilename);
//Read the NDX file
String ndxFilename = config.getParam("targetIdList");
//Remove the first element of each line which is the model name
XList tmpFileList(ndxFilename);
XList fileList;
for(unsigned long ll=0;ll<tmpFileList.getLineCount();ll++){
fileList.addLine();
for(unsigned long i=1;i<tmpFileList.getLine()->getElementCount();i++){
fileList.getLine(fileList.getLineCount()-1).addElement(tmpFileList.getLine(ll).getElement(i));
}
}
//Create and initialise the accumulator
TVAcc tvAcc(fileList, config);
Matrix<double> Q(tvAcc.getRankT(),tvAcc.getRankT());
Matrix<double> D(tvAcc.getNDistrib(),tvAcc.getRankT());
if(config.existsParam("loadEigenDecompositionParam") && config.getParam("loadEigenDecompositionParam").toBool()){ // Load normalized T matrix and weighted Covariance matrix if pre-computed
//Load TotalVariability matrix
String normTFilename = config.getParam("totalVariabilityMatrix") + "_norm";
tvAcc.loadT(normTFilename, config);
//Load D and Q matrices
String dFilename = config.getParam("matrixFilesPath") + config.getParam("totalVariabilityMatrix") + "_EigDec_D" + config.getParam("loadMatrixFilesExtension");
D.load(dFilename,config);
String qFilename = config.getParam("matrixFilesPath") + config.getParam("totalVariabilityMatrix") + "_EigDec_Q" + config.getParam("loadMatrixFilesExtension");
Q.load(qFilename,config);
}
else{
//Load TotalVariability matrix
tvAcc.loadT(config.getParam("totalVariabilityMatrix"), config);
// Normalize matrix T
tvAcc.normTMatrix();
// Compute weighted co-variance matrix by using UBM weight coefficients
DoubleSquareMatrix W(tvAcc.getRankT());
W.setAllValues(0.0);
tvAcc.getWeightedCov(W,world.getTabWeight(),config);
// Eigen Decomposition of W to get Q
Matrix<double> tmpW(W);
Q.setAllValues(0.0);
tvAcc.computeEigenProblem(tmpW,Q,tvAcc.getRankT(),config);
// Compute D matrices (approximation of Tc'Tc matrices)
D.setAllValues(0.0);
tvAcc.approximateTcTc(D,Q,config);
}
//Load the statistics from files or compute statistics for all segments at once
if((config.existsParam("loadAccs")) && config.getParam("loadAccs").toBool()){ //load pre-computed statistics
cout<<" (IvExtractor) Load Accumulators"<<endl;
tvAcc.loadN(config);
tvAcc.loadF_X(config);
}
else{ //Compute statistics if they don't exists
tvAcc.computeAndAccumulateTVStat(config);
tvAcc.saveAccs(config);
}
// Then load the meanEstimate computed by minDiv if required
DoubleVector meanEstimate = tvAcc.getUbmMeans();
if(config.existsParam("minDivergence")&& config.getParam("minDivergence").toBool()){
String minDivName = config.getParam("matrixFilesPath") + config.getParam("meanEstimate") + config.getParam("loadMatrixFilesExtension");
Matrix<double> tmpMean(minDivName,config);
for(unsigned long i=0;i<meanEstimate.size();i++){
meanEstimate[i] = tmpMean(0,i);
}
}
//Update the mean Estimate
cout<<" (IvExtractor) Load Mean Estimate"<<endl;
tvAcc.loadMeanEstimate(meanEstimate);
//Substract mean from the statistics and normalize co-variance
tvAcc.normStatistics(config);
//.........这里部分代码省略.........
示例3: IvExtractor
//-----------------------------------------------------------------------------------------------------------------------------------------------------------
int IvExtractor(Config& config)
{
String inputWorldFilename = config.getParam("inputWorldFilename");
// label for selected frames - Only the frames associated with this label, in the label files, will be used
bool fixedLabelSelectedFrame=true;
String labelSelectedFrames;
if (config.existsParam("useIdForSelectedFrame")) // the ID of each speaker is used as labelSelectedFrame ?
fixedLabelSelectedFrame=(config.getParam("useIdForSelectedFrame").toBool()==false);
if (fixedLabelSelectedFrame) // the label is decided by the command line and is unique for the run
labelSelectedFrames=config.getParam("labelSelectedFrames");
try{
MixtureServer ms(config);
if (verbose) cout << "(IvExtractor) TotalVariability - Load world model [" << inputWorldFilename<<"]"<<endl;
MixtureGD& world = ms.loadMixtureGD(inputWorldFilename);
//Load the statistics from files or compute statistics for all segments at once
//Read the NDX file
String ndxFilename = config.getParam("targetIdList");
//Remove the first element of each line which is the model name
XList tmpFileList(ndxFilename);
XList fileList;
for(unsigned long ll=0;ll<tmpFileList.getLineCount();ll++){
fileList.addLine();
for(unsigned long i=1;i<tmpFileList.getLine()->getElementCount();i++){
fileList.getLine(fileList.getLineCount()-1).addElement(tmpFileList.getLine(ll).getElement(i));
}
}
//Create and initialise the accumulator
TVAcc tvAcc(fileList, config);
//Load TotalVariability matrix
tvAcc.loadT(config.getParam("totalVariabilityMatrix"), config);
//Statistics
if((config.existsParam("loadAccs")) && config.getParam("loadAccs").toBool()){ //load pre-computed statistics
cout<<" (IvExtractor) Load Accumulators"<<endl;
tvAcc.loadN(config);
tvAcc.loadF_X(config);
}
else{ //Compute statistics if they don't exists
tvAcc.computeAndAccumulateTVStat(config);
tvAcc.saveAccs(config);
}
// Then load the meanEstimate computed by minDiv if required
DoubleVector meanEstimate = tvAcc.getUbmMeans();
if(config.existsParam("minDivergence")&& config.getParam("minDivergence").toBool()){
String minDivName = config.getParam("matrixFilesPath") + config.getParam("meanEstimate") + config.getParam("loadMatrixFilesExtension");
Matrix<double> tmpMean(minDivName,config);
for(unsigned long i=0;i<meanEstimate.size();i++){
meanEstimate[i] = tmpMean(0,i);
}
}
//Update the mean Estimate
cout<<" (IvExtractor) Load Mean Estimate"<<endl;
tvAcc.loadMeanEstimate(meanEstimate);
//Substract mean from the statistics
tvAcc.substractM(config);
//Compute vEvT for each session
tvAcc.estimateTETt(config);
// Estimate I-Vectors
tvAcc.estimateW(config);
cout<<"--------- save IV by File --------"<<endl;
tvAcc.saveWbyFile(config);
cout<<"--------- end of process --------"<<endl;
} // fin try
catch (Exception& e) {cout << e.toString().c_str() << endl;}
return 0;
}
示例4: TrainTargetLFA
//-----------------------------------------------------------------------------------------------------------------------------------------------------------
int TrainTargetLFA(Config& config)
{
String inputClientListFileName = config.getParam("targetIdList");
String inputWorldFilename = config.getParam("inputWorldFilename");
String outputSERVERFilename = "";
if (config.existsParam("mixtureServer")) outputSERVERFilename =config.getParam("mixtureServer");
bool initByClient=false; // In this case, the init model is read from the file
if (config.existsParam("initByClient")) initByClient=config.getParam("initByClient").toBool();
bool saveEmptyModel=false;
if (config.existsParam("saveEmptyModel")) saveEmptyModel=config.getParam("saveEmptyModel").toBool();
// label for selected frames - Only the frames associated with this label, in the label files, will be used
bool fixedLabelSelectedFrame=true;
String labelSelectedFrames;
if (config.existsParam("useIdForSelectedFrame")) // the ID of each speaker is used as labelSelectedFrame ?
fixedLabelSelectedFrame=(config.getParam("useIdForSelectedFrame").toBool()==false);
if (fixedLabelSelectedFrame) // the label is decided by the command line and is unique for the run
labelSelectedFrames=config.getParam("labelSelectedFrames");
bool modelData=false;
if (config.existsParam("useModelData")) modelData=config.getParam("useModelData").toBool();
String initModelS=inputWorldFilename;
if (modelData) if (config.existsParam("initModel")) initModelS=config.getParam("initModel"); // Use a specific model for Em init
bool outputAdaptParam=false;
if (config.existsParam("superVectors")) outputAdaptParam=true;
try{
XList inputClientList(inputClientListFileName,config); // read the Id + filenames for each client
XLine * linep;
inputClientList.getLine(0);
MixtureServer ms(config);
StatServer ss(config, ms);
if (verbose) cout << "(TrainTarget) Latent Factor Analysis - Load world model [" << inputWorldFilename<<"]"<<endl;
MixtureGD& world = ms.loadMixtureGD(inputWorldFilename);
if (verbose) cout <<"(TrainTarget) Use["<<initModelS<<"] for initializing EM"<<endl;
//LOAD JFA MAtrices
unsigned long svsize=world.getDistribCount()*world.getVectSize();
Matrix<double> U, V;
DoubleVector D(svsize,svsize);
//Initialise EC matrix
if(config.existsParam("eigenChannelMatrix")){
String uName = config.getParam("matrixFilesPath") + config.getParam("eigenChannelMatrix") + config.getParam("loadMatrixFilesExtension");
U.load (uName, config);
if (verboseLevel >=1) cout << "(TrainTargetLFA) Init EC matrix from "<< config.getParam("eigenChannelMatrix") <<" from EigenChannel Matrix: "<<", rank: ["<<U.rows() << "] sv size: [" << U.cols() <<"]"<<endl;
}
else{
U.setDimensions(1,svsize);
U.setAllValues(0.0);
if (verboseLevel >1) cout << "(TrainTargetLFA) Init EC matrix to 0"<<endl;
}
V.setDimensions(1,svsize);
V.setAllValues(0.0);
if (verboseLevel >=1) cout << "(TrainTargetLFA) Init EV matrix to 0"<<endl;
//Initialise the D matrix for MAP adaptation
for(unsigned long i=0; i<world.getDistribCount(); i++){
for(unsigned long j = 0; j<world.getVectSize(); j++){
D[i*world.getVectSize()+j] = sqrt(1.0/(world.getDistrib(i).getCovInv(j)*config.getParam("regulationFactor").toDouble()));
}
}
// *********** Target loop *****************
while ((linep=inputClientList.getLine()) != NULL){ // linep gives the XLine with the Id of a given client and the list of files
String *id=linep->getElement(); // Get the Client ID (id)
XLine featureFileListp=linep->getElements(); // Get the list of feature file for the client (end of the line)
if (verbose) cout << "(TrainTargetLFA) Train model ["<<*id<<"]"<<endl;
XList ndx; ndx.addLine() = featureFileListp;
JFAAcc jfaAcc(ndx,config,"TrainTarget");
//Charger les matrices V, U et D a partir des objets matrice existant.
jfaAcc.loadEV(V, config); jfaAcc.loadEC(U, config); jfaAcc.loadD(D);
//Initialise VU matrix
jfaAcc.initVU();
FeatureServer fs(config,featureFileListp); // Reading the features (from several files)
SegServer segmentsServer; // Create the segment server for managing the segments/clusters
LabelServer labelServer; // Create the lable server, for indexing the segments/clusters
initializeClusters(featureFileListp,segmentsServer,labelServer,config); // Reading the segmentation files for each feature input file
verifyClusterFile(segmentsServer,fs,config); // Verify if the segments ending before the end of the feature files...
MixtureGD & adaptedMixture = ms.duplicateMixture(world,DUPL_DISTRIB); // Creating final as a copy of the world model
MixtureGD & clientMixture= ms.duplicateMixture(world,DUPL_DISTRIB);
long codeSelectedFrame=labelServer.getLabelIndexByString(labelSelectedFrames); // Get the index of the cluster with in interest audio segments
if (codeSelectedFrame==-1){ // No data for this model !!!!!!!!!!!!!!
cout << " WARNING - NO DATA FOR TRAINING ["<<*id<<"]";
if (saveEmptyModel){
cout <<" World model is returned"<<endl; // In this case, the client model is the world model
if (verbose) cout << "Save client model ["<<*id<<"]" << endl;
adaptedMixture.save(*id, config); // Save the client model
}
}
else{
SegCluster& selectedSegments=segmentsServer.getCluster(codeSelectedFrame); // Gives the cluster of the selected/used segments
//.........这里部分代码省略.........
示例5: TrainTargetJFA
//-----------------------------------------------------------------------------------------------------------------------------------------------------------
int TrainTargetJFA(Config& config)
{
String inputClientListFileName = config.getParam("targetIdList");
String inputWorldFilename = config.getParam("inputWorldFilename");
String outputSERVERFilename = "";
if (config.existsParam("mixtureServer")) outputSERVERFilename =config.getParam("mixtureServer");
bool initByClient=false; // In this case, the init model is read from the file
if (config.existsParam("initByClient")) initByClient=config.getParam("initByClient").toBool();
bool saveEmptyModel=false;
if (config.existsParam("saveEmptyModel")) saveEmptyModel=config.getParam("saveEmptyModel").toBool();
// label for selected frames - Only the frames associated with this label, in the label files, will be used
bool fixedLabelSelectedFrame=true;
String labelSelectedFrames;
if (config.existsParam("useIdForSelectedFrame")) // the ID of each speaker is used as labelSelectedFrame ?
fixedLabelSelectedFrame=(config.getParam("useIdForSelectedFrame").toBool()==false);
if (fixedLabelSelectedFrame) // the label is decided by the command line and is unique for the run
labelSelectedFrames=config.getParam("labelSelectedFrames");
bool modelData=false;
if (config.existsParam("useModelData")) modelData=config.getParam("useModelData").toBool();
String initModelS=inputWorldFilename;
if (modelData) if (config.existsParam("initModel")) initModelS=config.getParam("initModel"); // Use a specific model for Em init
bool outputAdaptParam=false;
if (config.existsParam("superVectors")) outputAdaptParam=true;
try{
XList inputClientList(inputClientListFileName,config); // read the Id + filenames for each client
XLine * linep;
inputClientList.getLine(0);
MixtureServer ms(config);
StatServer ss(config, ms);
if (verbose) cout << "(TrainTarget) Joint Factor Analysis - Load world model [" << inputWorldFilename<<"]"<<endl;
MixtureGD& world = ms.loadMixtureGD(inputWorldFilename);
if (verbose) cout <<"(TrainTarget) Use["<<initModelS<<"] for initializing EM"<<endl;
//LOAD JFA MAtrices
Matrix<double> U, V;
DoubleVector D;
//Initialise EC matrix
if(config.existsParam("eigenChannelMatrix")){
String uName = config.getParam("matrixFilesPath") + config.getParam("eigenChannelMatrix") + config.getParam("loadMatrixFilesExtension");
U.load (uName, config);
if (verboseLevel >=1) cout << "(TrainTargetJFA) Init EC matrix from "<< config.getParam("eigenChannelMatrix") <<" from EigenChannel Matrix: "<<", rank: ["<<U.rows() << "] sv size: [" << U.cols() <<"]"<<endl;
}
else{
unsigned long sS = world.getVectSize() * world.getDistribCount();
U.setDimensions(1,sS);
U.setAllValues(0.0);
if (verboseLevel >=1) cout << "(TrainTargetJFA) Init EC matrix to 0"<<endl;
}
//Initialise EV matrix
if(config.existsParam("eigenVoiceMatrix")){
String vName = config.getParam("matrixFilesPath") + config.getParam("eigenVoiceMatrix") + config.getParam("loadMatrixFilesExtension");
V.load (vName, config);
if (verboseLevel >=1) cout << "(TrainTargetJFA) Init EV matrix from "<< config.getParam("eigenVoiceMatrix") <<" from EigenVoice Matrix: "<<", rank: ["<<V.rows() << "] sv size: [" << V.cols() <<"]"<<endl;
}
else{
unsigned long sS = world.getVectSize() * world.getDistribCount();
V.setDimensions(1,sS);
V.setAllValues(0.0);
if (verboseLevel >=1) cout << "(TrainTargetJFA) Init EV matrix to 0"<<endl;
}
//Initialise D matrix
if(config.existsParam("DMatrix")){
String dName = config.getParam("matrixFilesPath") + config.getParam("DMatrix") + config.getParam("loadMatrixFilesExtension");
Matrix<double> tmpD(dName, config);
if( (tmpD.rows() != 1) || ( tmpD.cols() != world.getVectSize()*world.getDistribCount() ) ){
throw Exception("Incorrect dimension of D Matrix",__FILE__,__LINE__);
}
else{
D.setSize(world.getVectSize()*world.getDistribCount());
D.setAllValues(0.0);
for(unsigned long i=0; i<world.getVectSize()*world.getDistribCount(); i++){
D[i] = tmpD(0,i);
}
if (verboseLevel >=1) cout << "(TrainTargetJFA) Init D matrix from "<<config.getParam("DMatrix")<<endl;
}
}
else{
unsigned long sS = world.getVectSize() * world.getDistribCount();
D.setSize(sS);
D.setAllValues(0.0);
if (verboseLevel >1) cout << "(TrainTargetJFA) Init D matrix to 0"<<endl;
}
// *********** Target loop *****************
while ((linep=inputClientList.getLine()) != NULL){ // linep gives the XLine with the Id of a given client and the list of files
String *id=linep->getElement(); // Get the Client ID (id)
XLine featureFileListp=linep->getElements(); // Get the list of feature file for the client (end of the line)
if (verbose) cout << "(TrainTarget) Train model ["<<*id<<"]"<<endl;
XList ndx; ndx.addLine() = featureFileListp;
JFAAcc jfaAcc(ndx,config,"TrainTarget");
//Load V, U and D from existing matrices.
//.........这里部分代码省略.........
示例6: TrainTargetFA
//-----------------------------------------------------------------------------------------------------------------------------------------------------------
int TrainTargetFA(Config& config)
{
String inputClientListFileName = config.getParam("targetIdList");
String inputWorldFilename = config.getParam("inputWorldFilename");
String outputSERVERFilename = "";
if (config.existsParam("mixtureServer")) outputSERVERFilename =config.getParam("mixtureServer");
bool initByClient=false; // In this case, the init model is read from the file
if (config.existsParam("initByClient")) initByClient=config.getParam("initByClient").toBool();
bool saveEmptyModel=false;
if (config.existsParam("saveEmptyModel")) saveEmptyModel=config.getParam("saveEmptyModel").toBool();
// label for selected frames - Only the frames associated with this label, in the label files, will be used
bool fixedLabelSelectedFrame=true;
String labelSelectedFrames;
if (config.existsParam("useIdForSelectedFrame")) // the ID of each speaker is used as labelSelectedFrame ?
fixedLabelSelectedFrame=(config.getParam("useIdForSelectedFrame").toBool()==false);
if (fixedLabelSelectedFrame) // the label is decided by the command line and is unique for the run
labelSelectedFrames=config.getParam("labelSelectedFrames");
bool modelData=false;
if (config.existsParam("useModelData")) modelData=config.getParam("useModelData").toBool();
String initModelS=inputWorldFilename;
if (modelData) if (config.existsParam("initModel")) initModelS=config.getParam("initModel"); // Use a specific model for Em init
bool outputAdaptParam=false;
if (config.existsParam("superVectors")) outputAdaptParam=true;
Matrix <double> ChannelMatrix;
if (verbose) cout<< "EigenMAP and Eigenchannel with [" << config.getParam("initChannelMatrix") << "] of size: [";
ChannelMatrix.load(config.getParam("initChannelMatrix"),config); //get Channel Matrix from args and load in a Matrix object
if (verbose) cout << ChannelMatrix.rows() << "," <<ChannelMatrix.cols() << "]" << endl;
bool varAdapt=false;
if (config.existsParam("FAVarAdapt")) varAdapt=true;
bool saveCompleteServer=false;
try{
XList inputClientList(inputClientListFileName,config); // read the Id + filenames for each client
XLine * linep;
inputClientList.getLine(0);
MixtureServer ms(config);
StatServer ss(config, ms);
if (verbose) cout << "(TrainTarget) Factor Analysis - Load world model [" << inputWorldFilename<<"]"<<endl;
MixtureGD& world = ms.loadMixtureGD(inputWorldFilename);
if (verbose) cout <<"(TrainTarget) Use["<<initModelS<<"] for initializing EM"<<endl;
// *********** Target loop *****************
while ((linep=inputClientList.getLine()) != NULL){ // linep gives the XLine with the Id of a given client and the list of files
String *id=linep->getElement(); // Get the Client ID (id)
XLine featureFileListp=linep->getElements(); // Get the list of feature file for the client (end of the line)
if (verbose) cout << "(TrainTarget) Train model ["<<*id<<"]"<<endl;
FeatureServer fs(config,featureFileListp); // Reading the features (from several files)
SegServer segmentsServer; // Create the segment server for managing the segments/clusters
LabelServer labelServer; // Create the lable server, for indexing the segments/clusters
initializeClusters(featureFileListp,segmentsServer,labelServer,config); // Reading the segmentation files for each feature input file
verifyClusterFile(segmentsServer,fs,config); // Verify if the segments ending before the end of the feature files...
MixtureGD & adaptedMixture = ms.duplicateMixture(world,DUPL_DISTRIB); // Creating final as a copy of the world model
MixtureGD & clientMixture= ms.duplicateMixture(world,DUPL_DISTRIB);
long codeSelectedFrame=labelServer.getLabelIndexByString(labelSelectedFrames); // Get the index of the cluster with in interest audio segments
if (codeSelectedFrame==-1){ // No data for this model !!!!!!!!!!!!!!
cout << " WARNING - NO DATA FOR TRAINING ["<<*id<<"]";
if (saveEmptyModel){
cout <<" World model is returned"<<endl; // In this case, the client model is the world model
if (verbose) cout << "Save client model ["<<*id<<"]" << endl;
adaptedMixture.save(*id, config); // Save the client model
}
}
else{
SegCluster& selectedSegments=segmentsServer.getCluster(codeSelectedFrame); // Gives the cluster of the selected/used segments
/// **** Factor Analysis Stuff
XList faNdx;
faNdx.addLine()=featureFileListp;
FactorAnalysisStat FA(faNdx,fs,config); // give all features to FA stats
//FA.computeAndAccumulateGeneralFAStats(selectedSegments,fs,config);
for(int i=0;i<config.getParam("nbTrainIt").toLong();i++){
if (verbose) cout << "------ Iteration ["<<i<<"] ------"<<endl;
FA.computeAndAccumulateGeneralFAStats(selectedSegments,fs,config);
/*if (!varAdapt) FA.getTrueSpeakerModel(clientMixture,linep->getElement(1));
else FA.getFactorAnalysisModel(clientMixture,linep->getElement(1));
if (verbose) cout << "LLK for model["<<*id<<"] at it["<<i-1<<"]="<<FA.getLLK(selectedSegments,clientMixture,fs,config) << endl; */
FA.estimateAndInverseL(config);
FA.substractSpeakerStats();
FA.getXEstimate();
FA.substractChannelStats();
FA.getYEstimate();
}
MixtureGD & sessionMixture= ms.duplicateMixture(world,DUPL_DISTRIB);
bool saveSessionModel=false;
if (config.existsParam("saveSessionModel")) saveSessionModel=true;
if (saveSessionModel) FA.getSessionModel(sessionMixture,linep->getElement(1));
if (!varAdapt) FA.getTrueSpeakerModel(clientMixture,linep->getElement(1)); // basically compute M_s_h=M+Dy_s and get a model
else FA.getFactorAnalysisModel(clientMixture,linep->getElement(1)); // get FA variance adapted model
if (verbose) cout << "Final LLK for model["<<*id<<"]="<<FA.getLLK(selectedSegments,clientMixture,fs,config) << endl;
/// **** End of FA
if (!outputAdaptParam) {
if (verbose) cout << "Save client model ["<<*id<<"]" << endl;
clientMixture.save(*id, config); // Save the client model
if (saveSessionModel) {
String sessionfile=*id+".session";
if (verbose) cout << "Save session model ["<<sessionfile<<"]" << endl;
sessionMixture.save(sessionfile,config);
//.........这里部分代码省略.........