Defines | Functions

TrainTools.cpp File Reference

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cassert>
#include <cmath>
#include <liatools.h>
#include <DoubleSquareMatrix.h>
Include dependency graph for TrainTools.cpp:

Go to the source code of this file.

Defines

#define ALIZE_TrainTools_cpp

Functions

void copyMixture (DistribGD &s, DistribGD &d)
unsigned long selectComponent (bool selectCompA[], XList &distribL, MixtureGD &inputM)
unsigned long selectComponent (bool selectCompA[], double wFactor, MixtureGD &inputM)
unsigned long selectComponent (bool selectCompA[], unsigned long nbTop, MixtureGD &inputM)
double reduceModel (bool selectCompA[], MixtureGD &inputM, MixtureGD &outputM)
void normalizeWeights (MixtureGD &outputM)
void fuseModels (const MixtureGD &model1, unsigned long nbFrameM1, const MixtureGD &model2, unsigned long nbFrameM2, MixtureGD &result)
void gaussianFusion (const DistribGD &g1, double w1, const DistribGD &g2, double w2, DistribGD &res, double &w)
void mixtureFusion (const MixtureGD &mixt, DistribGD &res, double &wres)
void normalizeMixture (MixtureGD &mixt, const DoubleVector &meanSignal, const DoubleVector &covSignal, bool zeroOne, unsigned long nbIt, bool meanOnly, Config &config)
void normalizeMixture (MixtureGD &mixt, const DoubleVector &meanSignal, const DoubleVector &covSignal, bool zeroOne, TrainCfg &trainCfg, Config &config)
void normalizeMixture (MixtureGD &mixt, const DoubleVector &meanSignal, const DoubleVector covSignal, bool zeroOne, Config &config)
void normalizeMixture (MixtureGD &mixt, TrainCfg &trainCfg, Config &config)
void normalizeMixture (MixtureGD &mixt, Config &config)
void normalizeMixture (MixtureGD &mixt, MAPCfg &mapCfg, Config &config)
double likelihoodLoss (const DistribGD &g1, double w1, const DistribGD &g2, double w2)
void computeMAPConst (const MixtureGD &initModel, MixtureGD &client, MAPCfg &cfg)
void computeMAPConst2 (const MixtureGD &initModel, MixtureGD &client, MAPCfg &cfg)
void copyMean (MixtureGD &mixtS, MixtureGD &mixtD)
void copyVar (MixtureGD &mixtS, MixtureGD &mixtD)
void copyWeight (MixtureGD &mixtS, MixtureGD &mixtD)
void computeMAPOccDep (const MixtureGD &initModel, MixtureGD &client, MAPCfg &cfg, double frameCount)
void computeModelBasedMAPOccDep (const MixtureGD &initModel, MixtureGD &client, MAPCfg &cfg, double frameCount)
void computeMAP (MixtureServer &ms, const MixtureGD &initModel, MixtureGD &client, unsigned long frameCount, Config &config)
void computeMAP (MixtureServer &ms, const MixtureGD &initModel, MixtureGD &client, unsigned long frameCount, MAPCfg &cfg)
double setItParameter (double begin, double end, int nbIt, int it)
void varianceControl (MixtureGD &model, double flooring, double ceiling, const DoubleVector &covSignal)
unsigned long computeMeanCov (Config &config, FeatureServer **fsTab, SegCluster **segTab, unsigned long nbStream, DoubleVector &mean, DoubleVector &cov)
unsigned long computeMeanCov (Config &config, FeatureServer &fs, SegCluster &seg, DoubleVector &mean, DoubleVector &cov)
void initialize01 (unsigned long vectSize, DoubleVector &mean, DoubleVector &cov)
MixtureGD & mixtureInit (MixtureServer &ms, FeatureServer &fs, MixtureGD &world, SegCluster &selectedSegments, const DoubleVector &globalCov, Config &config, TrainCfg &trainCfg)
MixtureGD & mixtureInit (MixtureServer &ms, FeatureServer **fsTab, SegCluster **segTab, double *weightTab, unsigned long nbStream, MixtureGD &world, const DoubleVector &globalCov, Config &config, TrainCfg &trainCfg)
MixtureGD & mixtureInit (MixtureServer &ms, FeatureServer &fs, MixtureGD &world, SegCluster &selectedSegments, const DoubleVector &globalCov, Config &config)
MixtureGD & mixtureInit (MixtureServer &ms, FeatureServer **fsTab, SegCluster **segTab, double *weightTab, unsigned long nbStream, MixtureGD &world, const DoubleVector &globalCov, Config &config)
Matrix< double > computeMLLR (MixtureGD &inM, MixtureGD &outM, unsigned long frameCount, Config &config)
void adaptModel (Config &config, StatServer &ss, MixtureServer &ms, FeatureServer &fs, SegCluster &selectedSegments, MixtureGD &aprioriModel, MixtureGD &clientMixture, MAPCfg &mapCfg)
void adaptModel (Config &config, StatServer &ss, MixtureServer &ms, FeatureServer &fs, SegCluster &selectedSegments, MixtureGD &aprioriModel, MixtureGD &clientMixture)
void modelBasedadaptModel (Config &config, StatServer &ss, MixtureServer &ms, FeatureServer &fs, SegCluster &selectedSegments, MixtureGD &aprioriModel, MixtureGD &clientMixture, MixtureGD &initModel)
void trainModel (Config &config, StatServer &ss, FeatureServer &fs, SegCluster &selectedSegments, DoubleVector &globalMean, DoubleVector &globalCov, MixtureGD &world, TrainCfg &trainCfg)
void trainModelStream (Config &config, MixtureServer &ms, StatServer &ss, FeatureServer **fsTab, SegCluster **segTab, double *weightTab, unsigned long nbStream, DoubleVector &globalMean, DoubleVector &globalCov, MixtureGD *&world, TrainCfg &trainCfg)
void trainModel (Config &config, StatServer &ss, FeatureServer &fs, SegCluster &selectedSegments, DoubleVector &globalMean, DoubleVector &globalCov, MixtureGD &world)
void trainModel (Config &config, MixtureServer &ms, StatServer &ss, FeatureServer **fsTab, SegCluster **segTab, double *weightTab, unsigned long nbStream, DoubleVector &globalMean, DoubleVector &globalCov, MixtureGD *&world)

Define Documentation

#define ALIZE_TrainTools_cpp

Definition at line 56 of file TrainTools.cpp.


Function Documentation

void adaptModel ( Config &  config,
StatServer &  ss,
MixtureServer &  ms,
FeatureServer &  fs,
SegCluster &  selectedSegments,
MixtureGD &  aprioriModel,
MixtureGD &  clientMixture,
MAPCfg mapCfg 
)
void adaptModel ( Config &  config,
StatServer &  ss,
MixtureServer &  ms,
FeatureServer &  fs,
SegCluster &  selectedSegments,
MixtureGD &  aprioriModel,
MixtureGD &  clientMixture 
)
void computeMAP ( MixtureServer &  ms,
const MixtureGD &  initModel,
MixtureGD &  client,
unsigned long  frameCount,
Config &  config 
)

Definition at line 543 of file TrainTools.cpp.

References computeMAP().

Referenced by adaptModel(), adaptModelMAP(), computeMAP(), crossValid(), and modelBasedadaptModel().

void computeMAP ( MixtureServer &  ms,
const MixtureGD &  initModel,
MixtureGD &  client,
unsigned long  frameCount,
MAPCfg cfg 
)
void computeMAPConst ( const MixtureGD &  initModel,
MixtureGD &  client,
MAPCfg cfg 
)
void computeMAPConst2 ( const MixtureGD &  initModel,
MixtureGD &  client,
MAPCfg cfg 
)
void computeMAPOccDep ( const MixtureGD &  initModel,
MixtureGD &  client,
MAPCfg cfg,
double  frameCount 
)
unsigned long computeMeanCov ( Config &  config,
FeatureServer **  fsTab,
SegCluster **  segTab,
unsigned long  nbStream,
DoubleVector &  mean,
DoubleVector &  cov 
)

Definition at line 595 of file TrainTools.cpp.

References accumulateStatFrame(), and initialize01().

Referenced by normFeat(), and trainWorld().

unsigned long computeMeanCov ( Config &  config,
FeatureServer &  fs,
SegCluster &  seg,
DoubleVector &  mean,
DoubleVector &  cov 
)

Definition at line 605 of file TrainTools.cpp.

References accumulateStatFrame(), and initialize01().

Matrix<double> computeMLLR ( MixtureGD &  inM,
MixtureGD &  outM,
unsigned long  frameCount,
Config &  config 
)

Definition at line 790 of file TrainTools.cpp.

References copyVar(), copyWeight(), verbose, and verboseLevel.

Referenced by adaptModel().

void computeModelBasedMAPOccDep ( const MixtureGD &  initModel,
MixtureGD &  client,
MAPCfg cfg,
double  frameCount 
)
void copyMean ( MixtureGD &  mixtS,
MixtureGD &  mixtD 
)

Definition at line 423 of file TrainTools.cpp.

void copyMixture ( DistribGD &  s,
DistribGD &  d 
)

Definition at line 166 of file TrainTools.cpp.

Referenced by reduceModel().

void copyVar ( MixtureGD &  mixtS,
MixtureGD &  mixtD 
)

Definition at line 432 of file TrainTools.cpp.

Referenced by computeMLLR().

void copyWeight ( MixtureGD &  mixtS,
MixtureGD &  mixtD 
)

Definition at line 441 of file TrainTools.cpp.

Referenced by computeMLLR().

void fuseModels ( const MixtureGD &  model1,
unsigned long  nbFrameM1,
const MixtureGD &  model2,
unsigned long  nbFrameM2,
MixtureGD &  result 
)

Definition at line 236 of file TrainTools.cpp.

Referenced by computeMAPmodelFromEMones().

void gaussianFusion ( const DistribGD &  g1,
double  w1,
const DistribGD &  g2,
double  w2,
DistribGD &  res,
double &  w 
)

Definition at line 257 of file TrainTools.cpp.

Referenced by mixtureFusion().

void initialize01 ( unsigned long  vectSize,
DoubleVector &  mean,
DoubleVector &  cov 
)

Definition at line 614 of file TrainTools.cpp.

Referenced by computeMeanCov(), and trainWorld().

double likelihoodLoss ( const DistribGD &  g1,
double  w1,
const DistribGD &  g2,
double  w2 
)

Definition at line 338 of file TrainTools.cpp.

Referenced by energyDetector().

void mixtureFusion ( const MixtureGD &  mixt,
DistribGD &  res,
double &  wres 
)

Definition at line 271 of file TrainTools.cpp.

References gaussianFusion().

Referenced by normalizeMixture().

MixtureGD& mixtureInit ( MixtureServer &  ms,
FeatureServer **  fsTab,
SegCluster **  segTab,
double *  weightTab,
unsigned long  nbStream,
MixtureGD &  world,
const DoubleVector &  globalCov,
Config &  config,
TrainCfg trainCfg 
)

Definition at line 676 of file TrainTools.cpp.

References accumulateStatFrame(), baggedSegments(), debug, totalFrame(), and verbose.

MixtureGD& mixtureInit ( MixtureServer &  ms,
FeatureServer &  fs,
MixtureGD &  world,
SegCluster &  selectedSegments,
const DoubleVector &  globalCov,
Config &  config 
)

Definition at line 769 of file TrainTools.cpp.

References mixtureInit().

Referenced by clusteringCriterionWithoutWorldInit(), mixtureInit(), and trainWorld().

MixtureGD& mixtureInit ( MixtureServer &  ms,
FeatureServer **  fsTab,
SegCluster **  segTab,
double *  weightTab,
unsigned long  nbStream,
MixtureGD &  world,
const DoubleVector &  globalCov,
Config &  config 
)

Definition at line 774 of file TrainTools.cpp.

References mixtureInit().

MixtureGD& mixtureInit ( MixtureServer &  ms,
FeatureServer &  fs,
MixtureGD &  world,
SegCluster &  selectedSegments,
const DoubleVector &  globalCov,
Config &  config,
TrainCfg trainCfg 
)
void modelBasedadaptModel ( Config &  config,
StatServer &  ss,
MixtureServer &  ms,
FeatureServer &  fs,
SegCluster &  selectedSegments,
MixtureGD &  aprioriModel,
MixtureGD &  clientMixture,
MixtureGD &  initModel 
)
void normalizeMixture ( MixtureGD &  mixt,
MAPCfg mapCfg,
Config &  config 
)
void normalizeMixture ( MixtureGD &  mixt,
const DoubleVector &  meanSignal,
const DoubleVector &  covSignal,
bool  zeroOne,
unsigned long  nbIt,
bool  meanOnly,
Config &  config 
)
void normalizeMixture ( MixtureGD &  mixt,
const DoubleVector &  meanSignal,
const DoubleVector &  covSignal,
bool  zeroOne,
TrainCfg trainCfg,
Config &  config 
)
void normalizeMixture ( MixtureGD &  mixt,
const DoubleVector &  meanSignal,
const DoubleVector  covSignal,
bool  zeroOne,
Config &  config 
)

Definition at line 319 of file TrainTools.cpp.

References normalizeMixture().

void normalizeMixture ( MixtureGD &  mixt,
TrainCfg trainCfg,
Config &  config 
)

Definition at line 325 of file TrainTools.cpp.

References normalizeMixture().

void normalizeMixture ( MixtureGD &  mixt,
Config &  config 
)

Definition at line 329 of file TrainTools.cpp.

References normalizeMixture().

void normalizeWeights ( MixtureGD &  outputM )

Definition at line 223 of file TrainTools.cpp.

Referenced by trainModelStream().

double reduceModel ( bool  selectCompA[],
MixtureGD &  inputM,
MixtureGD &  outputM 
)

Definition at line 206 of file TrainTools.cpp.

References copyMixture().

Referenced by trainModelStream().

unsigned long selectComponent ( bool  selectCompA[],
unsigned long  nbTop,
MixtureGD &  inputM 
)

Definition at line 197 of file TrainTools.cpp.

References TabWeight::getDistrib().

unsigned long selectComponent ( bool  selectCompA[],
XList &  distribL,
MixtureGD &  inputM 
)

Definition at line 175 of file TrainTools.cpp.

Referenced by trainModelStream().

unsigned long selectComponent ( bool  selectCompA[],
double  wFactor,
MixtureGD &  inputM 
)

Definition at line 186 of file TrainTools.cpp.

double setItParameter ( double  begin,
double  end,
int  nbIt,
int  it 
)

Definition at line 562 of file TrainTools.cpp.

Referenced by trainModel(), and trainModelStream().

void trainModel ( Config &  config,
MixtureServer &  ms,
StatServer &  ss,
FeatureServer **  fsTab,
SegCluster **  segTab,
double *  weightTab,
unsigned long  nbStream,
DoubleVector &  globalMean,
DoubleVector &  globalCov,
MixtureGD *&  world 
)

Definition at line 1118 of file TrainTools.cpp.

References TrainCfg::showConfig(), trainModelStream(), and verbose.

void trainModel ( Config &  config,
StatServer &  ss,
FeatureServer &  fs,
SegCluster &  selectedSegments,
DoubleVector &  globalMean,
DoubleVector &  globalCov,
MixtureGD &  world,
TrainCfg trainCfg 
)
void trainModel ( Config &  config,
StatServer &  ss,
FeatureServer &  fs,
SegCluster &  selectedSegments,
DoubleVector &  globalMean,
DoubleVector &  globalCov,
MixtureGD &  world 
)

Definition at line 1113 of file TrainTools.cpp.

References trainModel().

Referenced by clusteringCriterion(), clusteringCriterionWithoutWorldInit(), and trainModel().

void trainModelStream ( Config &  config,
MixtureServer &  ms,
StatServer &  ss,
FeatureServer **  fsTab,
SegCluster **  segTab,
double *  weightTab,
unsigned long  nbStream,
DoubleVector &  globalMean,
DoubleVector &  globalCov,
MixtureGD *&  world,
TrainCfg trainCfg 
)
void varianceControl ( MixtureGD &  model,
double  flooring,
double  ceiling,
const DoubleVector &  covSignal 
)

Definition at line 569 of file TrainTools.cpp.

References verbose.

Referenced by energyDetector(), trainModel(), and trainModelStream().