||
该软件包采用期望最大化(EM)算法拟合高斯混合模型(GMM),适用于任意维的数据集。
This package fits Gaussian mixture model (GMM) by expectation maximization (EM) algorithm.It works on data set of arbitrary dimensions.
在计算高维数据概率时,为了避免经常出现的浮点数下溢现象,采用了对数域计算概率等方法来提高数值稳定性。
Several techniques are applied to improve numerical stability, such as computing probability in logarithm domain to avoid float number underflow which often occurs when computing probability of high dimensional data.
该代码经过了精心设计,以利用向量化和矩阵分解来提高计算效率。
The code is also carefully tuned to be efficient by utilizing vertorization and matrix factorization.
这种算法被广泛使用。具体细节可以在教科书“模式识别与机器学习”或wiki页面中找到。
This algorithm is widely used. The detail can be found in the great textbook "Pattern Recognition and Machine Learning" or the wiki page
http://en.wikipedia.org/wiki/Expectation-maximization_algorithm
该函数是鲁棒且高效的,但是代码结构是经过特别组织的,以便于阅读。请尝试使用以下代码进行演示:
This function is robust and efficient yet the code structure is organized so that it is easy to read. Please try following code for a demo:
close all; clear;
d = 2;
k = 3;
n = 500;
[X,label] = mixGaussRnd(d,k,n);
plotClass(X,label);
m = floor(n/2);
X1 = X(:,1:m);
X2 = X(:,(m+1):end);
% train
[z1,model,llh] = mixGaussEm(X1,k);
figure;
plot(llh);
figure;
plotClass(X1,z1);
% predict
z2 = mixGaussPred(X2,model);
figure;
plotClass(X2,z2);
源码下载地址:
http://page5.dfpan.com/fs/7lac2j2232d16229169/
更多精彩文章请关注微信号:
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-19 21:34
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社