Gaussian mixture model - Matlab parameter training


Hillel

I am running a speech enhancement algorithm based on Gaussian mixture model. The problem is that the estimation algorithm underflows during training. XI am trying to calculate the product of the PDF of each frequnecy component of the Gaussian cluster given by the PDF of the logarithmic spectrum X_k(FFT function is done with K = 1..256) What I get is a product 256 exp(-v(k))such thatv(k)>=0

Here is a snippet of a MATLAB calculation: N- number of frames; M- number of mixtures; c_iweight of each mixture;

gamma(n,i) = c_i*f(X_n|I = i)

 for i=1 : N
    rep_DataMat(:,:,i) = repmat(DataMat(:,i),1,M); 
    gamma_exp(:,:) = (1./sqrt((2*pi*sigmaSqr_curr))).*exp(((-1)*((rep_DataMat(:,:,i) - mue_curr).^2)./(2*sigmaSqr_curr)));
    gamma_curr(i,:) = c_curr.*(prod(10*gamma_exp(:,:),1));
    alpha_curr(i,:) = gamma_curr(i,:)./sum(gamma_curr(i,:));
end

Since K = 256, the factor is less than 1, so the product quickly goes to zero. Is there a way to calculate the result that causes the underflow (eg logum or similar)?

detective eye

You can perform calculations in the log domain.

The conversion of the product product is simple. On the other hand, sum can be converted with something like logumexp . This works using the following formula:

log(a + b) = log(exp(log(a)) + exp(log(b)))
           = log(exp(loga) + exp(logb))

where logaand logbin the respective representation a, and bin the logarithmic domain. Then, the basic idea is to decompose the exponent with the largest independent variable (for example, logafor illustration purposes):

 log(exp(loga)+exp(logb)) = log(exp(loga)*(1+exp(logb-loga)))
                          = loga + log(1+exp(logb-loga))

Note that the same idea applies if more than two terms are to be added.

Related


Gaussian mixture model - Matlab parameter training

Hillel I am running a speech enhancement algorithm based on Gaussian mixture model. The problem is that the estimation algorithm underflows during training. XI am trying to calculate the product of the PDF of each frequnecy component of the Gaussian cluster gi

Gaussian mixture model - Matlab parameter training

Hillel I am running a speech enhancement algorithm based on Gaussian mixture model. The problem is that the estimation algorithm underflows during training. XI am trying to calculate the product of the PDF of each frequnecy component of the Gaussian cluster gi

Equivalent of Matlab "fit" of Gaussian mixture model in R?

Dentist_Not edible I have some time series data that looks like this: x <- c(0.5833, 0.95041, 1.722, 3.1928, 3.941, 5.1202, 6.2125, 5.8828, 4.3406, 5.1353, 3.8468, 4.233, 5.8468, 6.1872, 6.1245, 7.6262, 8.6887, 7.7549, 6.9805, 4.3217, 3.0347, 2.4026, 1.9317,

Gaussian Mixture Modeling Matlab

Ashwin Shank Im using a Gaussian mixture model to estimate the log-likelihood function (parameters are estimated by the EM algorithm) Im using Matlab ... My data size is: 17991402*1...17991402 1D data points: When I run gmdistribution.fit(X, 2) I get the desir

Gaussian Mixture Modeling Matlab

Ashwin Shank Im using a Gaussian mixture model to estimate the log-likelihood function (parameters are estimated by the EM algorithm) Im using Matlab ... My data size is: 17991402*1...17991402 1D data points: When I run gmdistribution.fit(X, 2) I get the desir

Gaussian Mixture Model for Image Histogram

Dotted glass I am trying to do automatic image segmentation of different regions of a 2D MR image based on pixel intensity values. The first step is to implement a Gaussian mixture model on the histogram of the image. I need to plot the resulting Gaussian obta

Gaussian Mixture Model for Image Histogram

Dotted glass I am trying to do automatic image segmentation of different regions of a 2D MR image based on pixel intensity values. The first step is to implement a Gaussian mixture model on the histogram of the image. I need to plot the resulting Gaussian obta

Gaussian Mixture Model Cross Validation

Newkid I want to perform cross validation on my Gaussian mixture model. Currently, my cross_validationapproach using sklearn is as follows. clf = GaussianMixture(n_components=len(np.unique(y)), covariance_type='full') cv_ortho = cross_validate(clf, parameters_

Gaussian Mixture Model for Image Histogram

Dotted glass I am trying to do automatic image segmentation of different regions of a 2D MR image based on pixel intensity values. The first step is to implement a Gaussian mixture model on the histogram of the image. I need to plot the resulting Gaussian obta

Gaussian Mixture Model Cross Validation

Newkid I want to perform cross validation on my Gaussian mixture model. Currently, my cross_validationapproach using sklearn is as follows. clf = GaussianMixture(n_components=len(np.unique(y)), covariance_type='full') cv_ortho = cross_validate(clf, parameters_

Gaussian Mixture Model (GMM) is not suitable

Book I've been using Scikit-learn's GMM function. First, I created a distribution along the line x=y. from sklearn import mixture import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D line_model = mixture.GMM(n_components

Gaussian Mixture Model (GMM) is not suitable

BenB I've been using Scikit-learn's GMM function. First, I created a distribution along the line x=y. from sklearn import mixture import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D line_model = mixture.GMM(n_components

Number of parameters in a Gaussian mixture model

golden_truth I have D-dimensional data with K components. How many parameters do I need if I use a model with a full covariance matrix? and if I use the diagonal covariance matrix how many? golden_truth xyLe_ 's answer in CrossValidated https://stats.stackexch

Gaussian Mixture Model Cross Validation

Newkid I want to perform cross validation on my Gaussian mixture model. Currently, my cross_validationapproach using sklearn is as follows. clf = GaussianMixture(n_components=len(np.unique(y)), covariance_type='full') cv_ortho = cross_validate(clf, parameters_

Gaussian Mixture Model for Image Histogram

Dotted glass I am trying to do automatic image segmentation of different regions of a 2D MR image based on pixel intensity values. The first step is to implement a Gaussian mixture model on the histogram of the image. I need to plot the resulting Gaussian obta

Gaussian Mixture Model for Image Histogram

Dotted glass I am trying to do automatic image segmentation of different regions of a 2D MR image based on pixel intensity values. The first step is to implement a Gaussian mixture model on the histogram of the image. I need to plot the resulting Gaussian obta

Gaussian Mixture Model Cross Validation

Newkid I want to perform cross validation on my Gaussian mixture model. Currently, my cross_validationapproach using sklearn is as follows. clf = GaussianMixture(n_components=len(np.unique(y)), covariance_type='full') cv_ortho = cross_validate(clf, parameters_

Gaussian Mixture Model (GMM) is not suitable

BenB I've been using Scikit-learn's GMM function. First, I created a distribution along the line x=y. from sklearn import mixture import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D line_model = mixture.GMM(n_components

Convert plot in Matlab from Gaussian mixture to uniform

username Consider the following vector plotted 2x1in Matlab whose probability distribution is a mixture of two Gaussian components. P=10^3; %number draws v=1; %First component mu_a = [0,0.5]; sigma_a = [v,0;0,v]; %Second component mu_b = [0,8.2]; sigma_b = [

Convert plot in Matlab from Gaussian mixture to uniform

username Consider the following vector plotted 2x1in Matlab whose probability distribution is a mixture of two Gaussian components. P=10^3; %number draws v=1; %First component mu_a = [0,0.5]; sigma_a = [v,0;0,v]; %Second component mu_b = [0,8.2]; sigma_b = [

Convert plot in Matlab from Gaussian mixture to uniform

username Consider the following vector plotted 2x1in Matlab whose probability distribution is a mixture of two Gaussian components. P=10^3; %number draws v=1; %First component mu_a = [0,0.5]; sigma_a = [v,0;0,v]; %Second component mu_b = [0,8.2]; sigma_b = [

MATLAB code for many Gaussian mixture models

Ali Bodaghi I have applied the gaussmix function in the Voicebox MATLAB tool to calculate the GMM. However, when I run it for 512 GMM components, the code gives me errors. No_of_Clusters = 512; No_of_Iterations = 10; [m_ubm1,v_ubm1,w_ubm1]=gaussmix(feature,[],

Convert plot in Matlab from Gaussian mixture to uniform

username Consider the following vector plotted 2x1in Matlab whose probability distribution is a mixture of two Gaussian components. P=10^3; %number draws v=1; %First component mu_a = [0,0.5]; sigma_a = [v,0;0,v]; %Second component mu_b = [0,8.2]; sigma_b = [

Convert plot in Matlab from Gaussian mixture to uniform

username Consider the following vector plotted 2x1in Matlab whose probability distribution is a mixture of two Gaussian components. P=10^3; %number draws v=1; %First component mu_a = [0,0.5]; sigma_a = [v,0;0,v]; %Second component mu_b = [0,8.2]; sigma_b = [

Problems with sklearn.mixture.GMM (Gaussian Mixture Model)

Gabriele Pompa I'm fairly new to scikit-lear and GMM in general...I have some questions about the fit quality of Gaussian mixture models in python (scikit-learn). I have an array of data that you can find in DATA HERE to match a GMM of n=2 components . As a be

PyMC3 Gaussian Mixture Model

Anjum Sayed I've been following PyMC3's Gaussian Mixture Model example here: https://github.com/pymc-devs/pymc3/blob/master/pymc3/examples/gaussian_mixture_model.ipynb , and it works perfectly with artificial datasets . I've tried using real datasets, but I'm

Clustering images using a Gaussian mixture model

ninja I want to cluster a binary image using GMM (Gaussian Mixture Model) and also want to plot the cluster centroids on the binary image itself. I used this as a reference : http://in.mathworks.com/help/stats/gaussian-mixture-models.html Here is my initial co

Clustering images using a Gaussian mixture model

ninja I want to cluster a binary image using GMM (Gaussian Mixture Model) and also want to plot the cluster centroids on the binary image itself. I used this as a reference : http://in.mathworks.com/help/stats/gaussian-mixture-models.html Here is my initial co

How to evaluate samples in a weighted Gaussian mixture model?

kind Lite: If I have a MoG model with n components, each component has its own weight w^n. I have a sample. I wish to calculate the probability of drawing samples from the MoG. I can easily evaluate individual Gaussians, but I don't know how to consider their