56 DllExport
CTrainNodeGMM(byte nStates, word nFeatures, byte maxGausses);
59 DllExport
void reset(
void);
61 DllExport
void addFeatureVec(
const Mat &featureVector, byte gt);
62 DllExport
void train(
bool doClean =
false);
66 DllExport
void saveFile(FILE *pFile)
const;
67 DllExport
void loadFile(FILE *pFile);
void saveFile(FILE *pFile) const
Saves the random model into the file.
double dist_Etreshold
Minimum Euclidean distance between Gauss functions.
double div_KLtreshold
Minimum Kullback-Leiber divergence between Gauss functions. If this parameter is negative, the merging of Gaussians in addFeatureVec() function will be disabled.
void reset(void)
Resets class variables.
void train(bool doClean=false)
Random model training.
struct DirectGraphicalModels::TrainNodeGMMParams TrainNodeGMMParams
Gaussian Mixture Model parameters.
Gaussian Mixture Model parameters.
CTrainNodeGMM(byte nStates, word nFeatures, TrainNodeGMMParams params=TRAIN_NODE_GMM_PARAMS_DEFAULT)
Constructor.
static const long double MAX_COEFFICIENT
word maxGausses
The maximal number of Gauss functions for approximation.
static const size_t MIN_SAMPLES
void calculateNodePotentials(const Mat &featureVector, Mat &potential, Mat &mask) const
Calculates the node potential, based on the feature vector.
virtual ~CTrainNodeGMM(void)
TrainNodeGMMParams m_params
const TrainNodeGMMParams TRAIN_NODE_GMM_PARAMS_DEFAULT
Gaussian Mixture Model training class.
Base abstract class for node potentials training.
double dist_Mtreshold
Minimum Mahalanobis distance between Gauss functions. If this parameter is negative, the Euclidean distance is used.
TrainNodeGMMParams(word _maxGausses, size_t _minSamples, double _dist_Etreshold, double _dist_Mtreshold, double _div_KLtreshold)
std::vector< GaussianMixture > m_vGaussianMixtures
size_t minSamples
Minimum number of sapmles to approximate a Gauss function.
void addFeatureVec(const Mat &featureVector, byte gt)
Adds new feature vector.
void loadFile(FILE *pFile)
Loads the random model from the file.