This class can be used to model Diagonal Gaussian Mixture Models.
Inheritance:
Public Fields
-
int n_gaussians
- number of Gaussians in the mixture
-
real prior_weights
- prior weights of the Gaussians, used in EM to give a small prior on each Gaussian
-
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.
-
MeasurerList* initial_kmeans_trainer_measurers
- as well as a measurer of this trainer
-
real* log_weights
- the pointers to the parameters
-
real* dlog_weights
- the pointers to the derivative of the parameters
-
real* var_threshold
- this contains the minimal value of each variance
-
Sequence* log_probabilities_g
- for each frame, for each gaussian, keep its log probability
-
int best_gauss
- gaussian that maximize the observed frame
-
Sequence* best_gauss_per_frame
- gaussian that maximize the observed frame
-
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
-
real** minus_half_over_var
- pre-computed -05 / var
-
real** means_acc
- accumulators for EM
Public Methods
-
DiagonalGMM(int n_inputs_, int n_gaussians_, EMTrainer* initial_kmeans_trainer_ = NULL)
-
virtual void reset()
- This methods have to call by the user to initialized the random parameters
-
virtual void setDataSet(DataSet* data_)
- If the KmeanTrainer has been given to the constructor, Kmeans algorithm is perform
-
virtual void setVarThreshold(real* var_threshold_)
- Set the minimum value for the variances
-
virtual void eMIterInitialize()
- Methods used to initialize the model at the beginning of each EM iteration
-
virtual void iterInitialize()
- Methods used to initialize the model at the beginning of each gradient descent iteration
-
virtual real frameLogProbability(int t, real* inputs)
- Returns the log probability of a frame of a sequence
-
virtual real viterbiFrameLogProbability(int t, real* inputs)
- Returns the log probability of a frame of a sequence on viterbi mode
-
virtual real frameLogProbabilityOneGaussian(int g, real* inputs)
- this method returns the log probability of the "g" Gaussian
-
virtual void sequenceInitialize(Sequence* inputs)
- Methods used to initialize the model at the beginning of each example during gradient descent training
-
virtual void eMSequenceInitialize(Sequence* inputs)
- Methods used to initialize the model at the beginning of each example during EM training
-
virtual void frameEMAccPosteriors(int t, real* inputs, real log_posterior)
- The backward step of EM for a frame
-
virtual void frameViterbiAccPosteriors(int t, real* inputs, real log_posterior)
- The backward step of Viterbi for a frame
-
virtual void eMUpdate()
- The update after each iteration for EM
-
virtual void update()
- The update after each iteration for gradient
-
virtual void frameBackward(int t, real* f_inputs, real* beta_, real* f_outputs, real* alpha_)
- Same as backward, but for one frame only
-
virtual void frameDecision(int t, real* decision)
- Returns the expected value in decision
Public Fields
-
real log_probability
-
Sequence* log_probabilities
Public Methods
-
virtual real logProbability(Sequence* inputs)
-
virtual real viterbiLogProbability(Sequence* inputs)
-
virtual void eMAccPosteriors(Sequence* inputs, real log_posterior)
-
virtual void viterbiAccPosteriors(Sequence* inputs, real log_posterior)
-
virtual void decode(Sequence* inputs)
-
virtual void eMForward(Sequence* inputs)
-
virtual void viterbiForward(Sequence* inputs)
-
virtual void viterbiBackward(Sequence* inputs, Sequence* alpha)
Public Members
-
Returns the decision of the distribution
Public Fields
-
int n_inputs
-
int n_outputs
-
Parameters* params
-
Parameters* der_params
-
Sequence* beta
Public Methods
-
virtual void forward(Sequence* inputs)
-
virtual void backward(Sequence* inputs, Sequence* alpha)
-
virtual void setPartialBackprop(bool flag=true)
-
virtual void frameForward(int t, real* f_inputs, real* f_outputs)
-
virtual void loadXFile(XFile* file)
-
virtual void saveXFile(XFile* file)
Inherited from Machine:
Public Fields
-
Sequence* outputs
Inherited from Object:
Public Fields
-
Allocator* allocator
Public Methods
-
void addOption(const char* name, int size, void* ptr, const char* help="")
-
void addIOption(const char* name, int* ptr, int init_value, const char* help="")
-
void addROption(const char* name, real* ptr, real init_value, const char* help="")
-
void addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
-
void addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
-
void setOption(const char* name, void* ptr)
-
void setIOption(const char* name, int option)
-
void setROption(const char* name, real option)
-
void setBOption(const char* name, bool option)
-
void setOOption(const char* name, Object* option)
-
void load(const char* filename)
-
void save(const char* filename)
-
void* operator new(size_t size, Allocator* allocator_=NULL)
-
void* operator new(size_t size, Allocator* allocator_, void* ptr_)
-
void 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).
- int n_gaussians
- number of Gaussians in the mixture
- real prior_weights
- prior weights of the Gaussians, used in EM to give
a small prior on each Gaussian
- 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.
one can give a initial trainer containing a kmeans
- MeasurerList* initial_kmeans_trainer_measurers
- as well as a measurer of this trainer
- real* log_weights
- the pointers to the parameters
- real* dlog_weights
- the pointers to the derivative of the parameters
- real* var_threshold
- this contains the minimal value of each variance
- Sequence* log_probabilities_g
- for each frame, for each gaussian, keep its log probability
- int best_gauss
- gaussian that maximize the observed frame
- Sequence* best_gauss_per_frame
- gaussian that maximize the observed frame
- 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
- real** minus_half_over_var
- pre-computed -05 / var
- real** means_acc
- accumulators for EM
- DiagonalGMM(int n_inputs_, int n_gaussians_, EMTrainer* initial_kmeans_trainer_ = NULL)
- virtual void reset()
-
This methods have to call by the user to initialized the
random parameters
- virtual void setDataSet(DataSet* data_)
-
If the KmeanTrainer has been given to the constructor, Kmeans algorithm
is perform
- virtual void setVarThreshold(real* var_threshold_)
-
Set the minimum value for the variances
- virtual void eMIterInitialize()
- Methods used to initialize the model at the beginning of each
EM iteration
- virtual void iterInitialize()
- Methods used to initialize the model at the beginning of each
gradient descent iteration
- virtual real frameLogProbability(int t, real* inputs)
- Returns the log probability of a frame of a sequence
- virtual real viterbiFrameLogProbability(int t, real* inputs)
- Returns the log probability of a frame of a sequence on viterbi mode
- virtual real frameLogProbabilityOneGaussian(int g, real* inputs)
- this method returns the log probability of the "g" Gaussian
- virtual void sequenceInitialize(Sequence* inputs)
- Methods used to initialize the model at the beginning of each
example during gradient descent training
- virtual void eMSequenceInitialize(Sequence* inputs)
- Methods used to initialize the model at the beginning of each
example during EM training
- virtual void frameEMAccPosteriors(int t, real* inputs, real log_posterior)
- The backward step of EM for a frame
- virtual void frameViterbiAccPosteriors(int t, real* inputs, real log_posterior)
- The backward step of Viterbi for a frame
- virtual void eMUpdate()
- The update after each iteration for EM
- virtual void update()
- The update after each iteration for gradient
- virtual void frameBackward(int t, real* f_inputs, real* beta_, real* f_outputs, real* alpha_)
- Same as backward, but for one frame only
- virtual 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++.