91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

Matlab實(shí)現(xiàn)EM算法,用于解決混合高斯模型, 包含用混合高斯模型生成測試數(shù)據(jù)的代碼,包含二維圖像生成代碼,模式隨機(jī)選取初值 和 用kmeans方法選取初值兩種方式

資源截圖

代碼片段和文件信息

function?[Lcount]?=?demo()
????marker?=?{‘*r‘‘+g‘‘.b‘‘xc‘‘om‘};
????
????%%?Generate?Sample
????mean?=?[4?5;10?15;15?10];
????covariance(::1)?=?[9?0;0?9];
????covariance(::2)?=?[6?0;0?6];
????covariance(::3)?=?[4?0;0?4];
????n?=?1000;?partion?=?[0.3?0.5?0.2];
????k?=?3;
????X?=?Generate_Sample(mean?covariance?n?partion);
????
????%%?Initialize?the?paramters
????%[WMV]?=?Init_Kmeans(Xk);
????%[WMV]?=?Init_Random();
????[WMV]?=?Init_Random2();
????
????%?start?timer
????t_start?=?clock;
????
????%%?E-M?Iteration
????e?=?0.000001;?EPS?=?1;
????count?=?1;
????while?EPS?>=?e
????????[El]?=?Exception(XkWMV);
????????[WMV]?=?Maximization(XkE);
????????L(count)?=?l;
????????if?count?==?1
????????????EPS?=?abs(l);
????????else
????????????EPS?=?abs(l?-?L(count-1));
????????end
????????count?=?count+1;?
????end
????%?calculate?elapsed?time
????elapsed_time?=?etime(clock?t_start);
????fprintf(‘Iteration?time??is?:?%.4f?s\nTteration?count?is?:?%d\n‘elapsed_timecount);
????
????%%?Draw?the?figure?of?clustering?procedures
????figure(2)
????hold?on
????for?i?=?1:n
????????[a?pos]?=?max(E(i:));
????????plot(X(i1)X(i2)char(marker(pos)));
????end
????title(‘E-M?Clustering?result‘);
????xlabel(‘x1‘)ylabel(‘x2‘);
????hold?off
????????
????%%?Draw?the?figure?of?the?convergence
????figure(3)
????hold?on
????plot(1:count-1L‘--r*‘);
????????title(‘E-M?Algorithm?Convergence‘);
????????xlabel(‘number?of?EM?steps‘)ylabel(‘The?log-likelihood‘);
????hold?off
????
end


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????236278??2012-11-04?20:12??pic\k-means-convergence.bmp

?????文件?????236278??2012-11-04?20:12??pic\k-means-result.bmp

?????文件?????????54??2012-11-04?20:12??pic\k-means-time.txt

?????文件?????236278??2012-11-04?20:32??pic\kmeans-random1-random2.bmp

?????文件?????236278??2012-11-04?20:20??pic\kmeans-random1.bmp

?????文件?????236278??2012-11-04?20:13??pic\random1-convergence.bmp

?????文件?????236278??2012-11-04?20:29??pic\random1-random2.bmp

?????文件?????236278??2012-11-04?20:14??pic\random1-result.bmp

?????文件?????????56??2012-11-04?20:28??pic\random1.txt

?????文件?????236278??2012-11-04?20:27??pic\random2-convergence.bmp

?????文件?????236278??2012-11-04?20:28??pic\random2-result.bmp

?????文件?????????54??2012-11-04?20:14??pic\random2-time.txt

?????文件?????236278??2012-11-04?16:51??pic\sample1.bmp

?????文件???????1568??2012-11-04?20:26??demo.m

?????文件????????363??2012-11-04?20:30??draw.m

?????文件????????744??2012-11-03?11:00??Exception.m

?????文件????????538??2012-11-04?16:50??Generate_Sample.m

?????文件????????655??2012-11-04?17:35??Init_Kmeans.m

?????文件????????257??2012-11-04?18:55??Init_Random.m

?????文件????????174??2012-11-04?20:24??Init_Random2.m

?????文件????????373??2012-11-03?10:14??Maximization.m

?????目錄??????????0??2012-11-05?09:25??pic

-----------?---------??----------?-----??----

??????????????2367616????????????????????22


評論

共有 條評論