MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Gaussian Mixture Model (GMM) optimization using maximal likelihood estimation via the Expection-Maximization (EM) algorithm. More...
#include <mdsEM.h>
Public Types | |
enum | { NO_ITERATOR_IS_DECLARED_FOR_TEMPLATE_PARAMETER = C::ITERATOR_DECLARED } |
Check that C has an iterator declared. More... | |
enum | { NUM_OF_DIMENSIONS = N } |
Dimensionality of input data. More... | |
typedef CGaussianFunc< double, N > | tComponent |
Gaussian function. | |
typedef C::tConstIterator | tConstIterator |
Container iterator type. | |
typedef C | tContainer |
Container type. | |
typedef CVector< double > | tVector |
Used internal vector type. | |
Public Member Functions | |
CHasOptions & | addOption (int Flag) |
Adds a given flag using bitwise OR operation. | |
bool | checkAllOptions (int Flags) const |
Checks if all specified flags are set. | |
bool | checkAnyOption (int Flags) const |
Checks if any of specified flags is set. | |
int | checkOption (int Flag) const |
Checks if a single flag is set. | |
CHasOptions & | clearOption (int Flag) |
Removes a given flag. | |
CMaxLikelihoodByEM (int Flags=MaxLikelihoodByEM::DEFAULT_FLAGS) | |
Default constructor. | |
bool | execute (const tContainer &Input) |
Estimates GMM of input data. | |
bool | execute (const tContainer &Input, tSize NumOfClasses) |
Estimates GMM of input data. | |
const tComponent & | getComponent (tSize i) const |
Returns reference to the i-th gaussian component. | |
tComponent & | getComponent (tSize i) |
bool | getMembership (tSize i, tVector &Membership) |
Returns soft membership function of the i-th input sample. | |
tSize | getMembership (tSize i) |
Returns index of the component into which the i-th input vector was classified (hard membership function). | |
tSize | getNumOfComponents () const |
Returns the number of components. | |
tSize | getNumOfDimensions () const |
Returns the number od dimensions. | |
int | getOptions () const |
Returns all flags. | |
CMaxLikelihoodByEM & | setMinAddChange (double dValue) |
Changes the minimal required change of the log-likelihood function which results in a new component addition. | |
CHasOptions & | setOption (int Flag) |
Adds a given flag using bitwise OR operation. | |
CHasOptions & | setOptions (int Flags) |
Sets complete flags. | |
virtual | ~CMaxLikelihoodByEM () |
Virtual destructor. | |
Protected Types | |
typedef std::vector< tComponent > | tComponents |
Gaussian functions representing mixture components/segments. | |
typedef tComponent::tVector | tCov |
Diagonal of the gaussian component covariance matrix. | |
typedef CMatrix< double > | tMaps |
Support maps. | |
typedef tComponent::tVector | tMean |
Gaussian component mean. | |
Protected Member Functions | |
void | addRandomNoise (double dNoiseCoeff) |
Add random noise to i-th component. | |
bool | areSeparated (tSize i, tSize j, int c) |
Checks degree of separation of two given components. | |
bool | checkForSimilarComponents () |
Checks for similar components. | |
void | clearSupportMaps () |
Clears all support maps. | |
double | computeLogLikelihood (const tContainer &Input) |
Returns value of the objective function. | |
double | computeMDL (double dLogLikelihood, tSize NumOfSamples) |
Compute the MDL (Minimum Descriptive Length) coefficient. | |
tSize | findComponent () |
Finds component which can be further splitted. | |
int | getDegreeOfSeparation (tSize NumOfComponents) |
Returns degree of separation. | |
void | initComponentCov (tSize i) |
Intialization of a component covariance matrix. | |
void | initComponentMean (tSize i, const tContainer &Input) |
Random intialization of i-th component mean value. | |
void | initComponentWeight (tSize i, double dWeight) |
Intialization of a component weight. | |
bool | initFirstComponent (const tContainer &Input) |
Initialization of the first mixture component. | |
double | iterateEM (const tContainer &Input, double dMinChange) |
Iterates both E-step and M-step. | |
void | processEStep (const tContainer &Input) |
E-step of the algorithm. | |
void | processMStep (const tContainer &Input) |
M-step of the algorithm. | |
void | splitComponent (tSize Index, tSize NewIndex) |
Splits a given component. | |
Protected Attributes | |
tComponents | m_Components |
Mixture model components. | |
double | m_dMinAddChange |
Minimal required change of the log-likelihood function which results in component addition. | |
tMaps | m_Maps |
Support maps. | |
CNormalPRNG | m_Normal |
Random number generator with normal distribution. | |
int | m_Options |
Optional flags. | |
CUniformPRNG | m_Uniform |
Uniform random number generator. |
Gaussian Mixture Model (GMM) optimization using maximal likelihood estimation via the Expection-Maximization (EM) algorithm.
typedef CGaussianFunc<double,N> mds::math::CMaxLikelihoodByEM< C, N >::tComponent |
Gaussian function.
typedef std::vector<tComponent> mds::math::CMaxLikelihoodByEM< C, N >::tComponents [protected] |
Gaussian functions representing mixture components/segments.
typedef C::tConstIterator mds::math::CMaxLikelihoodByEM< C, N >::tConstIterator |
Container iterator type.
typedef C mds::math::CMaxLikelihoodByEM< C, N >::tContainer |
Container type.
typedef tComponent::tVector mds::math::CMaxLikelihoodByEM< C, N >::tCov [protected] |
Diagonal of the gaussian component covariance matrix.
typedef CMatrix<double> mds::math::CMaxLikelihoodByEM< C, N >::tMaps [protected] |
Support maps.
typedef tComponent::tVector mds::math::CMaxLikelihoodByEM< C, N >::tMean [protected] |
Gaussian component mean.
typedef CVector<double> mds::math::CMaxLikelihoodByEM< C, N >::tVector |
Used internal vector type.
anonymous enum |
anonymous enum |
CMaxLikelihoodByEM::CMaxLikelihoodByEM | ( | int | Flags = MaxLikelihoodByEM::DEFAULT_FLAGS | ) |
Default constructor.
virtual mds::math::CMaxLikelihoodByEM< C, N >::~CMaxLikelihoodByEM | ( | ) | [virtual] |
Virtual destructor.
CHasOptions& mds::base::CHasOptions::addOption | ( | int | Flag | ) | [inherited] |
Adds a given flag using bitwise OR operation.
void CMaxLikelihoodByEM::addRandomNoise | ( | double | dNoiseCoeff | ) | [protected] |
Add random noise to i-th component.
bool CMaxLikelihoodByEM::areSeparated | ( | tSize | i, |
tSize | j, | ||
int | c | ||
) | [protected] |
Checks degree of separation of two given components.
bool mds::base::CHasOptions::checkAllOptions | ( | int | Flags | ) | const [inherited] |
Checks if all specified flags are set.
bool mds::base::CHasOptions::checkAnyOption | ( | int | Flags | ) | const [inherited] |
Checks if any of specified flags is set.
bool CMaxLikelihoodByEM::checkForSimilarComponents | ( | ) | [protected] |
Checks for similar components.
int mds::base::CHasOptions::checkOption | ( | int | Flag | ) | const [inherited] |
Checks if a single flag is set.
CHasOptions& mds::base::CHasOptions::clearOption | ( | int | Flag | ) | [inherited] |
Removes a given flag.
void CMaxLikelihoodByEM::clearSupportMaps | ( | ) | [protected] |
Clears all support maps.
double CMaxLikelihoodByEM::computeLogLikelihood | ( | const tContainer & | Input | ) | [protected] |
Returns value of the objective function.
double CMaxLikelihoodByEM::computeMDL | ( | double | dLogLikelihood, |
tSize | NumOfSamples | ||
) | [protected] |
Compute the MDL (Minimum Descriptive Length) coefficient.
bool CMaxLikelihoodByEM::execute | ( | const tContainer & | Input | ) |
Estimates GMM of input data.
bool CMaxLikelihoodByEM::execute | ( | const tContainer & | Input, |
tSize | NumOfClasses | ||
) |
Estimates GMM of input data.
tSize CMaxLikelihoodByEM::findComponent | ( | ) | [protected] |
Finds component which can be further splitted.
const tComponent& mds::math::CMaxLikelihoodByEM< C, N >::getComponent | ( | tSize | i | ) | const |
Returns reference to the i-th gaussian component.
tComponent& mds::math::CMaxLikelihoodByEM< C, N >::getComponent | ( | tSize | i | ) |
int CMaxLikelihoodByEM::getDegreeOfSeparation | ( | tSize | NumOfComponents | ) | [protected] |
Returns degree of separation.
bool CMaxLikelihoodByEM::getMembership | ( | tSize | i, |
tVector & | Membership | ||
) |
Returns soft membership function of the i-th input sample.
tSize CMaxLikelihoodByEM::getMembership | ( | tSize | i | ) |
Returns index of the component into which the i-th input vector was classified (hard membership function).
tSize mds::math::CMaxLikelihoodByEM< C, N >::getNumOfComponents | ( | ) | const |
Returns the number of components.
tSize mds::math::CMaxLikelihoodByEM< C, N >::getNumOfDimensions | ( | ) | const |
Returns the number od dimensions.
int mds::base::CHasOptions::getOptions | ( | ) | const [inherited] |
Returns all flags.
void CMaxLikelihoodByEM::initComponentCov | ( | tSize | i | ) | [protected] |
Intialization of a component covariance matrix.
void CMaxLikelihoodByEM::initComponentMean | ( | tSize | i, |
const tContainer & | Input | ||
) | [protected] |
Random intialization of i-th component mean value.
void CMaxLikelihoodByEM::initComponentWeight | ( | tSize | i, |
double | dWeight | ||
) | [protected] |
Intialization of a component weight.
bool CMaxLikelihoodByEM::initFirstComponent | ( | const tContainer & | Input | ) | [protected] |
Initialization of the first mixture component.
double CMaxLikelihoodByEM::iterateEM | ( | const tContainer & | Input, |
double | dMinChange | ||
) | [protected] |
Iterates both E-step and M-step.
void CMaxLikelihoodByEM::processEStep | ( | const tContainer & | Input | ) | [protected] |
E-step of the algorithm.
void CMaxLikelihoodByEM::processMStep | ( | const tContainer & | Input | ) | [protected] |
M-step of the algorithm.
CMaxLikelihoodByEM< C, N > & CMaxLikelihoodByEM::setMinAddChange | ( | double | dValue | ) |
Changes the minimal required change of the log-likelihood function which results in a new component addition.
CHasOptions& mds::base::CHasOptions::setOption | ( | int | Flag | ) | [inherited] |
Adds a given flag using bitwise OR operation.
CHasOptions& mds::base::CHasOptions::setOptions | ( | int | Flags | ) | [inherited] |
Sets complete flags.
void CMaxLikelihoodByEM::splitComponent | ( | tSize | Index, |
tSize | NewIndex | ||
) | [protected] |
Splits a given component.
tComponents mds::math::CMaxLikelihoodByEM< C, N >::m_Components [protected] |
Mixture model components.
double mds::math::CMaxLikelihoodByEM< C, N >::m_dMinAddChange [protected] |
Minimal required change of the log-likelihood function which results in component addition.
tMaps mds::math::CMaxLikelihoodByEM< C, N >::m_Maps [protected] |
Support maps.
CNormalPRNG mds::math::CMaxLikelihoodByEM< C, N >::m_Normal [protected] |
Random number generator with normal distribution.
int mds::base::CHasOptions::m_Options [protected, inherited] |
Optional flags.
CUniformPRNG mds::math::CMaxLikelihoodByEM< C, N >::m_Uniform [protected] |
Uniform random number generator.