Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends

alize::MixtureStat Class Reference

#include <MixtureStat.h>

Inheritance diagram for alize::MixtureStat:
Inheritance graph
[legend]
Collaboration diagram for alize::MixtureStat:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MixtureStat (StatServer &, const Mixture &, const Config &)
virtual ~MixtureStat ()
MixturegetMixture () const
void resetLLK ()
lk_t computeLLK (const Feature &f)
lk_t computeLLK (const Feature &f, unsigned long idx)
lk_t getLLK () const
lk_t getAccumulatedLLK () const
lk_t computeAndAccumulateLLK (const Feature &f, double w=1.0f, const TopDistribsAction &a=TOP_DISTRIBS_NO_ACTION)
lk_t computeAndAccumulateLLK (const Feature &f, const LKVector &topDistribsVector, double w=1.0f)
lk_t computeAndAccumulateLLK ()
lk_t accumulateLLK (lk_t llk, double w=1.0)
lk_t getMeanLLK () const
double getAccumulatedLLKFeatureCount () const
void resetOcc ()
real_t getAccumulatedOccFeatureCount () const
DoubleVectorgetOccVect ()
const DoubleVectorgetOccVect () const
DoubleVectorgetAccumulatedOccVect ()
const DoubleVectorgetAccumulatedOccVect () const
occ_t getAccumulatedOcc ()
real_t computeAndAccumulateOcc (const Feature &f, weight_t w=1.0)
DoubleVectorgetMeanOccVect ()
virtual void resetEM ()=0
virtual occ_t computeAndAccumulateEM (const Feature &f, real_t weight=1.0)=0
virtual void addAccEM (const MixtureStat &)=0
virtual const MixturegetEM ()=0
real_t getEMFeatureCount () const
virtual String getClassName () const =0
virtual String toString () const

Protected Member Functions

real_t computeOccVect (const Feature &)
void assertResetEMDone () const

Protected Attributes

const unsigned long _distribCount
const Mixture_pMixture
const Config_config
const lk_t _minLLK
const lk_t _maxLLK
lk_t _llk
lk_t _accumulatedLLK
double _featureCounterForAccumulatedLK
DoubleVector _occVect
DoubleVector _accumulatedOccVect
DoubleVector _meanOccVect
real_t _featureCounterForAccumulatedOcc
bool _resetedEM
StatServer_pStatServer
real_t _featureCounterForEM

Private Member Functions

bool operator== (const MixtureStat &) const
bool operator!= (const MixtureStat &) const
const MixtureStatoperator= (const MixtureStat &)
 MixtureStat (const MixtureStat &)

Friends

class TestMixtureGFStat
class TestMixtureGDStat
class TestMixtureStat

Detailed Description

Abstract class used to make calculation in a Mixture object and to store and accumulate results

Author:
Frederic Wils frederic.wils@lia.univ-avignon.fr
Version:
1.0
Date:
2003

Definition at line 85 of file MixtureStat.h.


Constructor & Destructor Documentation

alize::MixtureStat::MixtureStat ( StatServer ,
const Mixture ,
const Config  
) [explicit]
virtual alize::MixtureStat::~MixtureStat (  ) [virtual]
alize::MixtureStat::MixtureStat ( const MixtureStat  ) [private]

Not implemented


Member Function Documentation

lk_t alize::MixtureStat::accumulateLLK ( lk_t  llk,
double  w = 1.0 
)

Accumulates the log-likelihood.

Parameters:
llkthe value to accumulate
wthe weigth (0...1)
Returns:
the same log-likelihood value (not multiplied by w)
virtual void alize::MixtureStat::addAccEM ( const MixtureStat  ) [pure virtual]
void alize::MixtureStat::assertResetEMDone (  ) const [protected]
virtual occ_t alize::MixtureStat::computeAndAccumulateEM ( const Feature f,
real_t  weight = 1.0 
) [pure virtual]

Acumulate data for EM algorithm

Parameters:
fthe feature (data)
Exceptions:
Exceptionif resetEM() have not been called beforehand or something else goes wrong
Returns:
sum of occupations BEFORE normalization
lk_t alize::MixtureStat::computeAndAccumulateLLK (  )

Like computeAndAccumulateLLK(const Feature& f...) but using the internal precalculated log-likelihood array.

Returns:
the log-likelihood value
Exceptions:
Exceptionif no mixture server is connected to the stat server (the log-likelihood array is not computed)
lk_t alize::MixtureStat::computeAndAccumulateLLK ( const Feature f,
double  w = 1.0f,
const TopDistribsAction a = TOP_DISTRIBS_NO_ACTION 
)

Like computeLLK() and, in addition, accumulate the log-likelihood. The internal feature counter increases by w.

Parameters:
fthe feature
wthe weight of the feature
aflag used to deal with top distributions
Returns:
the log-likelihood for this feature (not multiplied by w)
Exceptions:
Exceptionif the dimension of the mixture is not equals to the dimension of the feature
lk_t alize::MixtureStat::computeAndAccumulateLLK ( const Feature f,
const LKVector topDistribsVector,
double  w = 1.0f 
)

Like computeLLK() and, in addition, accumulate the log-likelihood. The internal feature counter increases by w.

Parameters:
fthe feature
wthe weight of the feature
topDistribsVectora top distributions vector
Returns:
the log-likelihood for this feature (not multiplied by w)
Exceptions:
Exceptionif the dimension of the mixture is not equals to the dimension of the feature
real_t alize::MixtureStat::computeAndAccumulateOcc ( const Feature f,
weight_t  w = 1.0 
)

Computes and accumulates occupation of a feature

Parameters:
fthe feature
wthe weight of the feature
Returns:
???
lk_t alize::MixtureStat::computeLLK ( const Feature f,
unsigned long  idx 
)

Computes log-likelihood between a mixture and a parameter of a feature

Parameters:
fthe feature
idxthe index of the parameter of the feature
Returns:
the log-likelihood
lk_t alize::MixtureStat::computeLLK ( const Feature f )

Computes log-likelihood between a mixture and a feature

Parameters:
fthe feature
Returns:
the log-likelihood
real_t alize::MixtureStat::computeOccVect ( const Feature  ) [protected]
lk_t alize::MixtureStat::getAccumulatedLLK (  ) const

Returns the accumulated log-likelihood computed between the mixture and the last feature

Returns:
the accumulated log-likelihood computed between the mixture and the last feature
double alize::MixtureStat::getAccumulatedLLKFeatureCount (  ) const

Returns the count of accumulated features for llk

Returns:
the count of accumulated features for llk
occ_t alize::MixtureStat::getAccumulatedOcc (  )

Computes and return the sum of accumulated occupations

Returns:
the sum of accumulated occupations
real_t alize::MixtureStat::getAccumulatedOccFeatureCount (  ) const

Returns the count of accumulated features for occupation

Returns:
the count of accumulated features
DoubleVector& alize::MixtureStat::getAccumulatedOccVect (  )

Gets a reference to the vector of accumulated occupations.

Returns:
a reference to the vector of accumulated occupations
const DoubleVector& alize::MixtureStat::getAccumulatedOccVect (  ) const
virtual String alize::MixtureStat::getClassName (  ) const [pure virtual]

Returns the name of the class

Returns:
the name of the class of the object as a String

Implements alize::Object.

Implemented in alize::MixtureGDStat, and alize::MixtureGFStat.

virtual const Mixture& alize::MixtureStat::getEM (  ) [pure virtual]

Gets the result of EM accumulation.

Returns:
a constant mixture.
Exceptions:
Exceptionif resetEm() have not been called beforehand

Implemented in alize::MixtureGDStat, and alize::MixtureGFStat.

real_t alize::MixtureStat::getEMFeatureCount (  ) const

Returns the count of accumulated features for EM

Returns:
the count of accumulated features for EM
lk_t alize::MixtureStat::getLLK (  ) const

Returns the last log-likelihood computation stored for the mixture

Returns:
the log-likelihood computed between the mixture and the last feature
lk_t alize::MixtureStat::getMeanLLK (  ) const

Computes and returns the mean of the accumulated log-likelihood. The accumulated value is simply divided by the value of the feature counter.

Returns:
the mean of the accumulated log-likelihood
Exceptions:
Exceptionif the mean cannot be computed (no likelihood accumulation)
DoubleVector& alize::MixtureStat::getMeanOccVect (  )

Gets a reference to the vector of mean occupations.

Returns:
a reference to the vector of mean occupations.
Exceptions:
Exceptionif no occ accumulated
Mixture& alize::MixtureStat::getMixture (  ) const

Returns the mixture of this accumulator

Returns:
the mixture of this accumulator
const DoubleVector& alize::MixtureStat::getOccVect (  ) const
DoubleVector& alize::MixtureStat::getOccVect (  )

Gets a reference to the vector of occupations.

Returns:
a reference to the vector of occupations
bool alize::MixtureStat::operator!= ( const MixtureStat  ) const [private]

Not implemented

const MixtureStat& alize::MixtureStat::operator= ( const MixtureStat  ) [private]

Not implemented

bool alize::MixtureStat::operator== ( const MixtureStat  ) const [private]
virtual void alize::MixtureStat::resetEM (  ) [pure virtual]

Reset all internal variables used for EM computation

Implemented in alize::MixtureGDStat, and alize::MixtureGFStat.

void alize::MixtureStat::resetLLK (  )

Resets internal variables used to store likelihood computation results between the mixture and a feature or a set of features :
> log-likelihood between the mixture and a feature
> accumulation of log-likelihoods
> feature counter

void alize::MixtureStat::resetOcc (  )

Resets internal variables used to store occupation of a feature or a set of features

virtual String alize::MixtureStat::toString (  ) const [virtual]

This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object

Returns:
a description of the object

Reimplemented from alize::Object.


Friends And Related Function Documentation

friend class TestMixtureGDStat [friend]

Reimplemented in alize::MixtureGDStat.

Definition at line 88 of file MixtureStat.h.

friend class TestMixtureGFStat [friend]

Definition at line 87 of file MixtureStat.h.

friend class TestMixtureStat [friend]

Definition at line 89 of file MixtureStat.h.


Member Data Documentation

Definition at line 277 of file MixtureStat.h.

Definition at line 281 of file MixtureStat.h.

const Config& alize::MixtureStat::_config [protected]

Definition at line 272 of file MixtureStat.h.

const unsigned long alize::MixtureStat::_distribCount [protected]

Definition at line 270 of file MixtureStat.h.

Definition at line 278 of file MixtureStat.h.

Definition at line 283 of file MixtureStat.h.

Definition at line 287 of file MixtureStat.h.

Definition at line 276 of file MixtureStat.h.

const lk_t alize::MixtureStat::_maxLLK [protected]

Definition at line 274 of file MixtureStat.h.

Definition at line 282 of file MixtureStat.h.

const lk_t alize::MixtureStat::_minLLK [protected]

Definition at line 273 of file MixtureStat.h.

Definition at line 280 of file MixtureStat.h.

Definition at line 271 of file MixtureStat.h.

Definition at line 286 of file MixtureStat.h.

Definition at line 285 of file MixtureStat.h.


The documentation for this class was generated from the following file: