Fit a multivariate gaussian mixture by a cross-entropy method. Cross-Entropy is a powerfull tool to achieve stochastic multi-extremum optimization.
Please visit http://iew3.technion.ac.il/CE/ for more informations
i) Please compile mex-files by the mexme_ce_gauss.m (if compiler is not setup, run mex -setup before.
ii) Run the program demo test_ce_mvgm.m
Sebastien PARIS (2020). Multivariate Gaussian Mixture Model Optimization by Cross En (https://www.mathworks.com/matlabcentral/fileexchange/7055-multivariate-gaussian-mixture-model-optimization-by-cross-en), MATLAB Central File Exchange. Retrieved .
I followed the instruction, and run mexme_ce_gauss.m and test_ce_mvgm.m. However I got an error about 'Error using corr2cov; R must be (d x d x n1 , .... x nl)'
Why did I get such error?
thanks for your reply
This toolbox fit a gaussian mixture with the CE approach ... If you need the mixture estimation to compute your entropies, in this case yes....
my problem is to find entropy of each component in gaussian mixture model.. can i find using your code?
thanks in advance
Thanks for the reply. So, changing "unsigned long" to "int" in all files seems to have solved both problems. Probably not the cleanest solution but it works for now :-)
Yes, it's seems to have a bug on Linux 64 bits with GCC ... it's a question long int definition between 32 & 64 I think. On windows, it's working either on 32 or 64... I don't have a Linux 64 close to me to debug ...
Very nice piece of software!
Have you tried to run it on Linux? Something seems to be wrong and I am not sure whether it is the compiler or something else. Basically sample_mvgm doesn't seem to work properly. The simple call
generates numbers in the range -10^10 to 10^10. Have you experienced something like that? Also the optimization runs much much slower (ca. 3x) than on Windows. According to the Matlab-profiler the bottleneck is in the last line of sample_gaussian_mixture when dirirnd is called.
I am running ubuntu 10.04 64bit on a i7 quad core
tried Matlab 2009b and 2010a
tried gcc-4.1 and gcc-4.4
always same behavior
Thanks for you help!
Sorry---compiler is LCC.
and your C compiler ? LCC, MSVC ?
Microsoft Windows XP Version 5.1 (Build 2600: SP2)
Intel Core(TM)2 Duo CPU T7300@2.00GHz
MATLAB Version 126.96.36.1999 (R2010a)
Java VM Version: Java 1.6.0_12-b04
Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
* MATLAB Compiler Version 4.13 (R2010a
Geoffrey, please give you exact plateform, i.e., OS, CPU, Compiler and so on ... Thanks you
mex files compile without error and test_ce_mvgm runs without error but hangs, requiring force-kill of Matlab 2010a to recover. Using debugger, so far, sample_gaussian_mixture.m is the routine hanging....
I think randnt is not well compiled. Did you had the correct option
mex -DranSHR3 randnt.c
mex -DranKISS randnt.c
Solved that one. (Needed to compile mex files!)
Now, I get NaNs!
t = 2, current sol = NaN, global sol = Inf, d = 0
t = 3, current sol = NaN, global sol = Inf, d = 0
t = 4, current sol = NaN, global sol = Inf, d = 0
Perhaps a revision is required for higher verions of matlab. Could not run the code on R2009b. Passing a 3XK matrix as input, I get
??? Index exceeds matrix dimensions.
Error in ==> ce_mvgm at 314
Rmax(indice1) = Ra(indice1)/9 + 2*Ra(indice1)/9;
Ra is of dimension 1X3 and indice1 has indexes up to 9.
nice way to learn about gaussian mixture models.
Includes an optional animated display of the current solution as it converges, which is fun.
One nice feature is that it can estimate the number of guassian mixtures that are present. Given the correct starting number, it did better than the EM method I used (at least for the single challenging case I looked at).
Offers a lot of control of the starting and boundary conditions, which may be important in some applications.
Mostly written in c, with windows dll. means its less portable. Even so, it is still slow.
Fixed for modern Matlab & OS64
-Correct a problem with LCC compiler for dirirnd.c
-Add mexme_ce_gauss.m to compile mex-files
v1.4 - Update randnt.c with a new uniform generator
V1.3 Missing files
V 1.2 -Add a better procedure to estimate weight's mixture
Missing randnt mex file in the Zip distribution.....
V1.1 : -add extra parameters in the main function