Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

alize::StatServer Class Reference

#include <StatServer.h>

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

List of all members.

Public Member Functions

 StatServer (const Config &c)
 StatServer (const Config &c, MixtureServer &ms)
virtual ~StatServer ()
void reset ()
lk_t computeLLK (const Mixture &m, const Feature &f) const
lk_t computeLLK (const Mixture &m, const Feature &f, unsigned long idx) const
void computeAllDistribLK (const Feature &f)
const LKVectorgetTopDistribIndexVector () const
void setTopDistribIndexVector (const ULongVector &indexVect, real_t sumNonTopDistribWeights, real_t sumNonTopDistribLK)
 DEPRECATED (real_t getAccumulatedOccFeatureCount(const Mixture &m))
void resetLLK (const Mixture &m)
 DEPRECATED (lk_t getLLK(const Mixture &m))
lk_t computeAndAccumulateLLK (const Mixture &m, const Feature &f, const TopDistribsAction &a=TOP_DISTRIBS_NO_ACTION)
lk_t computeAndAccumulateLLK (const Mixture &m, const Feature &f, double w, const TopDistribsAction &a=TOP_DISTRIBS_NO_ACTION)
 DEPRECATED (void accumulateLLK(const Mixture &m, double l, double w=1.0))
lk_t getMeanLLK (const Mixture &m)
 DEPRECATED (lk_t computeAndAccumulateLLK(const Mixture &m))
 DEPRECATED (void resetOcc(const Mixture &m))
 DEPRECATED (real_t computeAndAccumulateOcc(const Mixture &m, const Feature &f))
 DEPRECATED (occ_t *getMeanOccVect(const Mixture &m))
 DEPRECATED (occ_t *getAccumulatedOccVect(const Mixture &m))
 DEPRECATED (occ_t getAccumulatedOcc(const Mixture &m))
 DEPRECATED (void resetEM(const Mixture &m))
 DEPRECATED (occ_t computeAndAccumulateEM(const Mixture &m, const Feature &))
 DEPRECATED (const Mixture &getEM(const Mixture &m))
MixtureStatcreateAndStoreMixtureStat (const Mixture &m)
MixtureGDStatcreateAndStoreMixtureStat (MixtureGD &m)
MixtureGFStatcreateAndStoreMixtureStat (MixtureGF &m)
MixtureGDStatcreateAndStoreMixtureGDStat (Mixture &m)
MixtureGFStatcreateAndStoreMixtureGFStat (Mixture &m)
unsigned long getMixtureStatCount () const
MixtureStatgetMixtureStat (unsigned long idx)
MixtureGDStatgetMixtureGDStat (unsigned long idx)
MixtureGFStatgetMixtureGFStat (unsigned long idx)
void deleteMixtureStat (MixtureStat &m)
void deleteMixtureStat (unsigned long begin, unsigned long end)
void deleteAllMixtureStat ()
unsigned long getMixtureStatIndex (MixtureStat &m) const
ViterbiAccumcreateViterbiAccum ()
const StringgetServerName () const
void setServerName (const String &s)
virtual String getClassName () const
virtual String toString () const
const DoubleVectorgetDistribLKVector (const K &) const
LKVectorgetTopDistribIndexVector (const K &)
lk_t computeLLK (const K &, const Mixture &) const
lk_t computeLLK (const K &, const Mixture &m, const Feature &f, const TopDistribsAction &a)
lk_t computeLLK (const K &, const Mixture &m, const Feature &f, const LKVector &lkVect)

Static Public Member Functions

static FrameAccGD createFrameAccGD ()
static FrameAccGF createFrameAccGF ()

Private Member Functions

lk_t computeLLK (lk_t lk) const
MixtureStatgetMixtureStat (const Mixture &m)
 StatServer (const StatServer &)
const StatServeroperator= (const StatServer &)
bool operator== (const StatServer &) const
bool operator!= (const StatServer &) const

Private Attributes

String _serverName
const Config_config
DoubleVector _distribLKVect
MixtureServer_pMixtureServer
RefVector< MixtureStat_mixtureStatVect
RefVector< ViterbiAccum_viterbiAccumVect
const Mixture_pLastMixture
MixtureStat_pLastMixtureStat
LKVector _topDistribsVect
const lk_t _minLLK
const lk_t _maxLLK

Friends

class TestStatServer
class TestMixtureGDStat

Detailed Description

This class is used to compute all the statistics needed for models training and adapting algorithms as well as for decoding algorithms.

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

Definition at line 104 of file StatServer.h.


Constructor & Destructor Documentation

alize::StatServer::StatServer ( const Config c ) [explicit]

Creates a StatServer object with a specific configuration

Parameters:
cconfiguration of the server The server stores a pointer to the configuration.
alize::StatServer::StatServer ( const Config c,
MixtureServer ms 
) [explicit]

Creates a StatServer object with a specific configuration

Parameters:
cconfiguration of the server The server stores a pointer to the configuration.
msa mixture server.
virtual alize::StatServer::~StatServer (  ) [virtual]
alize::StatServer::StatServer ( const StatServer  ) [private]

internal use


Member Function Documentation

void alize::StatServer::computeAllDistribLK ( const Feature f )

Computes the log-likelihood between ALL the distributions of the server and the feature. The results are store in an array.
That is useful when many distributions are shared by mixtures. The log-likelihood is just computed once for each distribution.

Parameters:
fthe feature
lk_t alize::StatServer::computeAndAccumulateLLK ( const Mixture m,
const Feature f,
const TopDistribsAction a = TOP_DISTRIBS_NO_ACTION 
)

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

Parameters:
mthe mixture
fthe feature
aflag used to deal with top distributions
Returns:
the log-likelihood for this feature (not the accumulated value)
Exceptions:
Exceptionif the dimension of the mixture is not equals to the dimension of the feature
Deprecated:
since 1.06
lk_t alize::StatServer::computeAndAccumulateLLK ( const Mixture m,
const Feature f,
double  w,
const TopDistribsAction a = TOP_DISTRIBS_NO_ACTION 
)

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

Parameters:
mthe mixture
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
Deprecated:
since 1.06
lk_t alize::StatServer::computeLLK ( const Mixture m,
const Feature f 
) const

Computes log-likelihood between a mixture and a feature

Parameters:
mthe mixture
fthe feature
Returns:
the log-likelihood

Referenced by alize::ViterbiAccum::computeStateLLK().

lk_t alize::StatServer::computeLLK ( const K ,
const Mixture  
) const
lk_t alize::StatServer::computeLLK ( const K ,
const Mixture m,
const Feature f,
const TopDistribsAction a 
)
lk_t alize::StatServer::computeLLK ( const K ,
const Mixture m,
const Feature f,
const LKVector lkVect 
)
lk_t alize::StatServer::computeLLK ( const Mixture m,
const Feature f,
unsigned long  idx 
) const

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

Parameters:
mthe mixture
fthe feature
idxindex of the parameter of the feature
Returns:
the log-likelihood
lk_t alize::StatServer::computeLLK ( lk_t  lk ) const [private]
MixtureGDStat& alize::StatServer::createAndStoreMixtureGDStat ( Mixture m )

Creates, stores in the server and returns an accumulator of statistics for a GD mixture

Parameters:
mthe GD mixture
Returns:
the GD accumulator
Exceptions:
Exceptionif m type is not GD
MixtureGFStat& alize::StatServer::createAndStoreMixtureGFStat ( Mixture m )

Creates, stores in the server and returns an accumulator of statistics for a GF mixture

Parameters:
mthe GF mixture
Returns:
the GF accumulator
Exceptions:
Exceptionif m type is not GF
MixtureStat& alize::StatServer::createAndStoreMixtureStat ( const Mixture m )

Creates, stores in the server and returns an accumulator of statistics for a generic mixture

Parameters:
mthe mixture
Returns:
the generic accumulator
MixtureGFStat& alize::StatServer::createAndStoreMixtureStat ( MixtureGF m )

Creates, stores in the server and returns an accumulator of statistics for a GF mixture

Parameters:
mthe GF mixture
Returns:
the GF accumulator
MixtureGDStat& alize::StatServer::createAndStoreMixtureStat ( MixtureGD m )

Creates, stores in the server and returns an accumulator of statistics for a GD mixture

Parameters:
mthe GD mixture
Returns:
the GD accumulator
static FrameAccGD alize::StatServer::createFrameAccGD (  ) [static]

Returns a FrameAccGD object. The objet is not stored inside the server

static FrameAccGF alize::StatServer::createFrameAccGF (  ) [static]

Returns a FrameAccGF object. The objet is not stored inside the server

ViterbiAccum& alize::StatServer::createViterbiAccum (  )

Creates and stores a ViterbiAccum object in a pool of objects inside the server.

void alize::StatServer::deleteAllMixtureStat (  )

Deletes all mixture acumulators

void alize::StatServer::deleteMixtureStat ( MixtureStat m )

Deletes a mixture acumulator

Parameters:
mthe accumulator
void alize::StatServer::deleteMixtureStat ( unsigned long  begin,
unsigned long  end 
)

Deletes a mixture acumulator

Parameters:
beginindex of the first accumulator
endindex of the last accumulator
alize::StatServer::DEPRECATED ( lk_t   getLLKconst Mixture &m )

***** DEPRECATED *****
Returns the last log-likelihood computation stored for a mixture

Parameters:
mthe mixture
Returns:
the log-likelihood computed between the mixture and the last feature
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( real_t   computeAndAccumulateOccconst Mixture &m, const Feature &f )

***** DEPRECATED *****
Computes and accumulates occupation of a feature

Parameters:
fthe feature
mthe mixture
Deprecated:
since 1.06
Returns:
sum of occupations BEFORE normalization
alize::StatServer::DEPRECATED ( occ_t getMeanOccVectconst Mixture &m )

***** DEPRECATED *****
Gets a pointer to the vector of mean occupations.

Parameters:
mthe mixture
Returns:
a pointer
Exceptions:
Exceptionif no occ accumulated
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( occ_t getAccumulatedOccVectconst Mixture &m )

***** DEPRECATED *****
Gets a pointer to the vector of accumulated occupations.

Parameters:
mthe mixture
Returns:
a pointer
Exceptions:
Exceptionif no occ accumulated
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( occ_t   getAccumulatedOccconst Mixture &m )

***** DEPRECATED *****
Computes and return the sum of accumulated occupations

Parameters:
mthe mixture
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( void   resetEMconst Mixture &m )

***** DEPRECATED *****
Reset all internal variables used for EM computation

Parameters:
mthe mixture
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( occ_t   computeAndAccumulateEMconst Mixture &m, const Feature & )

***** DEPRECATED *****
Compute an iteration of EM and accumulate results.

Parameters:
mthe mixture
Exceptions:
Exceptionif resetEm() have not been called beforehand
Exceptionif something else goes wrong
Returns:
sum of occupations BEFORE normalization
alize::StatServer::DEPRECATED ( const Mixture getEMconst Mixture &m )

***** DEPRECATED *****
Gets the result of EM accumulation.

Parameters:
mthe mixture
Returns:
a constant mixture.
Exceptions:
Exceptionif resetEm() have not been called beforehand
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( void   accumulateLLKconst Mixture &m, double l, double w=1.0 )

***** DEPRECATED *****
Accumulates the log-likelihood.
Increase internal feature counter by w

Parameters:
mthe mixture
lthe value to accumulate
wthe weight (0...1)
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( real_t   getAccumulatedOccFeatureCountconst Mixture &m )

***** DEPRECATED *****
Returns the count of accumulated features for occupation

Parameters:
mthe mixture
Returns:
the count of accumulated features
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( lk_t   computeAndAccumulateLLKconst Mixture &m )

***** DEPRECATED *****
Like computeAndAccumulateLLK(Mixture& mix, const Feature& f) but using the internal precalculated log-likelihood array.

Parameters:
mthe mixture
Returns:
the log-likelihood value
Exceptions:
Exceptionif no mixture server is connected to this stat server (the log-likelihood array is not computed)
Deprecated:
since 1.06
alize::StatServer::DEPRECATED ( void   resetOccconst Mixture &m )

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

Parameters:
mthe mixture
Deprecated:
since 1.06
virtual String alize::StatServer::getClassName (  ) const [virtual]

Returns the name of the class

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

Implements alize::Object.

const DoubleVector& alize::StatServer::getDistribLKVector ( const K  ) const
lk_t alize::StatServer::getMeanLLK ( const Mixture m )

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

Parameters:
mthe mixture
Returns:
the mean of the accumulated log-likelihood
Exceptions:
Exceptionif the mean cannot be computed (no likelihood accumulation)
Deprecated:
since 1.06
MixtureGDStat& alize::StatServer::getMixtureGDStat ( unsigned long  idx )

Returns the mixture GD accumulator with index i

Parameters:
ithe index
Returns:
the mixture GD accumulator with index i
MixtureGFStat& alize::StatServer::getMixtureGFStat ( unsigned long  idx )

Returns the mixture GF accumulator with index i

Parameters:
idxthe index
Returns:
the mixture GF accumulator with index i
MixtureStat& alize::StatServer::getMixtureStat ( unsigned long  idx )

Returns the generic mixture accumulator with index i

Parameters:
idxthe index
Returns:
the generic mixture accumulator with index i
MixtureStat& alize::StatServer::getMixtureStat ( const Mixture m ) [private]
Parameters:
m
unsigned long alize::StatServer::getMixtureStatCount (  ) const

Returns the count of mixture accumulators stored in the server

Returns:
the count of mixture accumulators stored in the server
unsigned long alize::StatServer::getMixtureStatIndex ( MixtureStat m ) const

Returns the index of a MixtureStat object

Parameters:
mthe MixtureStat object
Returns:
the index of a MixtureStat object
Exceptions:
Exceptionif m cannot be found in the server
const String& alize::StatServer::getServerName (  ) const
LKVector& alize::StatServer::getTopDistribIndexVector ( const K  )
const LKVector& alize::StatServer::getTopDistribIndexVector (  ) const

Returns the best distributions index vector defined after calling computeAndAccumulateLLK(...)

Returns:
the best distributions index vector
bool alize::StatServer::operator!= ( const StatServer  ) const [private]

Not implemented

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

Not implemented

bool alize::StatServer::operator== ( const StatServer  ) const [private]

Not implemented

void alize::StatServer::reset (  )

Resets the server. Delete all temporary objects.

void alize::StatServer::resetLLK ( const Mixture m )

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

Parameters:
mthe mixture
Deprecated:
since 1.06
void alize::StatServer::setServerName ( const String s )
void alize::StatServer::setTopDistribIndexVector ( const ULongVector indexVect,
real_t  sumNonTopDistribWeights,
real_t  sumNonTopDistribLK 
)

Sets indexes of internal top distrib vector

Parameters:
indexVectvector of indexes
sumNonTopDistribWeights
sumNonTopDistribLK
virtual String alize::StatServer::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]

Definition at line 107 of file StatServer.h.

friend class TestStatServer [friend]

Definition at line 106 of file StatServer.h.


Member Data Documentation

Definition at line 454 of file StatServer.h.

Definition at line 455 of file StatServer.h.

Definition at line 463 of file StatServer.h.

Definition at line 462 of file StatServer.h.

Definition at line 457 of file StatServer.h.

Definition at line 459 of file StatServer.h.

Definition at line 460 of file StatServer.h.

Definition at line 456 of file StatServer.h.

Definition at line 453 of file StatServer.h.

Definition at line 461 of file StatServer.h.

Definition at line 458 of file StatServer.h.


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