class DiagonalGMM

This class can be used to model Diagonal Gaussian Mixture Models.

Inheritance:


Public Fields

[more]int n_gaussians
number of Gaussians in the mixture
[more]real prior_weights
prior weights of the Gaussians, used in EM to give a small prior on each Gaussian
[more]EMTrainer* initial_kmeans_trainer
optional initializations if nothing is given, then random calling by reset(), at your own risks or model loaded by the user.
[more]MeasurerList* initial_kmeans_trainer_measurers
as well as a measurer of this trainer
[more]real* log_weights
the pointers to the parameters
[more]real* dlog_weights
the pointers to the derivative of the parameters
[more]real* var_threshold
this contains the minimal value of each variance
[more]Sequence* log_probabilities_g
for each frame, for each gaussian, keep its log probability
[more]int best_gauss
gaussian that maximize the observed frame
[more]Sequence* best_gauss_per_frame
gaussian that maximize the observed frame
[more]real* sum_log_var_plus_n_obs_log_2_pi
in order to faster the computation, we can do some "pre-computation" pre-computed sum_log_var + n_obs * log_2_pi
[more]real** minus_half_over_var
pre-computed -05 / var
[more]real** means_acc
accumulators for EM

Public Methods

[more] DiagonalGMM(int n_inputs_, int n_gaussians_, EMTrainer* initial_kmeans_trainer_ = NULL)
[more]virtual void reset()
This methods have to call by the user to initialized the random parameters
[more]virtual void setDataSet(DataSet* data_)
If the KmeanTrainer has been given to the constructor, Kmeans algorithm is perform
[more]virtual void setVarThreshold(real* var_threshold_)
Set the minimum value for the variances
[more]virtual void eMIterInitialize()
Methods used to initialize the model at the beginning of each EM iteration
[more]virtual void iterInitialize()
Methods used to initialize the model at the beginning of each gradient descent iteration
[more]virtual real frameLogProbability(int t, real* inputs)
Returns the log probability of a frame of a sequence
[more]virtual real viterbiFrameLogProbability(int t, real* inputs)
Returns the log probability of a frame of a sequence on viterbi mode
[more]virtual real frameLogProbabilityOneGaussian(int g, real* inputs)
this method returns the log probability of the "g" Gaussian
[more]virtual void sequenceInitialize(Sequence* inputs)
Methods used to initialize the model at the beginning of each example during gradient descent training
[more]virtual void eMSequenceInitialize(Sequence* inputs)
Methods used to initialize the model at the beginning of each example during EM training
[more]virtual void frameEMAccPosteriors(int t, real* inputs, real log_posterior)
The backward step of EM for a frame
[more]virtual void frameViterbiAccPosteriors(int t, real* inputs, real log_posterior)
The backward step of Viterbi for a frame
[more]virtual void eMUpdate()
The update after each iteration for EM
[more]virtual void update()
The update after each iteration for gradient
[more]virtual void frameBackward(int t, real* f_inputs, real* beta_, real* f_outputs, real* alpha_)
Same as backward, but for one frame only
[more]virtual void frameDecision(int t, real* decision)
Returns the expected value in decision


Inherited from Distribution:

Public Fields

oreal log_probability
oSequence* log_probabilities

Public Methods

ovirtual real logProbability(Sequence* inputs)
ovirtual real viterbiLogProbability(Sequence* inputs)
ovirtual void eMAccPosteriors(Sequence* inputs, real log_posterior)
ovirtual void viterbiAccPosteriors(Sequence* inputs, real log_posterior)
ovirtual void decode(Sequence* inputs)
ovirtual void eMForward(Sequence* inputs)
ovirtual void viterbiForward(Sequence* inputs)
ovirtual void viterbiBackward(Sequence* inputs, Sequence* alpha)

Public Members

o Returns the decision of the distribution


Inherited from GradientMachine:

Public Fields

oint n_inputs
oint n_outputs
oParameters* params
oParameters* der_params
oSequence* beta

Public Methods

ovirtual void forward(Sequence* inputs)
ovirtual void backward(Sequence* inputs, Sequence* alpha)
ovirtual void setPartialBackprop(bool flag=true)
ovirtual void frameForward(int t, real* f_inputs, real* f_outputs)
ovirtual void loadXFile(XFile* file)
ovirtual void saveXFile(XFile* file)


Inherited from Machine:

Public Fields

oSequence* outputs


Inherited from Object:

Public Fields

oAllocator* allocator

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="")
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="")
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="")
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
ovoid addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid setOOption(const char* name, Object* option)
ovoid load(const char* filename)
ovoid save(const char* filename)
ovoid* operator new(size_t size, Allocator* allocator_=NULL)
ovoid* operator new(size_t size, Allocator* allocator_, void* ptr_)
ovoid operator delete(void* ptr)


Documentation

This class can be used to model Diagonal Gaussian Mixture Models. They can be trained using either EM (with EMTrainer) or gradient descent (with GMTrainer).

oint n_gaussians
number of Gaussians in the mixture

oreal prior_weights
prior weights of the Gaussians, used in EM to give a small prior on each Gaussian

oEMTrainer* initial_kmeans_trainer
optional initializations if nothing is given, then random calling by reset(), at your own risks or model loaded by the user. one can give a initial trainer containing a kmeans

oMeasurerList* initial_kmeans_trainer_measurers
as well as a measurer of this trainer

oreal* log_weights
the pointers to the parameters

oreal* dlog_weights
the pointers to the derivative of the parameters

oreal* var_threshold
this contains the minimal value of each variance

oSequence* log_probabilities_g
for each frame, for each gaussian, keep its log probability

oint best_gauss
gaussian that maximize the observed frame

oSequence* best_gauss_per_frame
gaussian that maximize the observed frame

oreal* sum_log_var_plus_n_obs_log_2_pi
in order to faster the computation, we can do some "pre-computation" pre-computed sum_log_var + n_obs * log_2_pi

oreal** minus_half_over_var
pre-computed -05 / var

oreal** means_acc
accumulators for EM

o DiagonalGMM(int n_inputs_, int n_gaussians_, EMTrainer* initial_kmeans_trainer_ = NULL)

ovirtual void reset()
This methods have to call by the user to initialized the random parameters

ovirtual void setDataSet(DataSet* data_)
If the KmeanTrainer has been given to the constructor, Kmeans algorithm is perform

ovirtual void setVarThreshold(real* var_threshold_)
Set the minimum value for the variances

ovirtual void eMIterInitialize()
Methods used to initialize the model at the beginning of each EM iteration

ovirtual void iterInitialize()
Methods used to initialize the model at the beginning of each gradient descent iteration

ovirtual real frameLogProbability(int t, real* inputs)
Returns the log probability of a frame of a sequence

ovirtual real viterbiFrameLogProbability(int t, real* inputs)
Returns the log probability of a frame of a sequence on viterbi mode

ovirtual real frameLogProbabilityOneGaussian(int g, real* inputs)
this method returns the log probability of the "g" Gaussian

ovirtual void sequenceInitialize(Sequence* inputs)
Methods used to initialize the model at the beginning of each example during gradient descent training

ovirtual void eMSequenceInitialize(Sequence* inputs)
Methods used to initialize the model at the beginning of each example during EM training

ovirtual void frameEMAccPosteriors(int t, real* inputs, real log_posterior)
The backward step of EM for a frame

ovirtual void frameViterbiAccPosteriors(int t, real* inputs, real log_posterior)
The backward step of Viterbi for a frame

ovirtual void eMUpdate()
The update after each iteration for EM

ovirtual void update()
The update after each iteration for gradient

ovirtual void frameBackward(int t, real* f_inputs, real* beta_, real* f_outputs, real* alpha_)
Same as backward, but for one frame only

ovirtual void frameDecision(int t, real* decision)
Returns the expected value in decision


Direct child classes:
MAPDiagonalGMM
KMeans
Author:
Samy Bengio (bengio@idiap.ch) Johnny Mariethoz (Johnny.Mariethoz@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.