⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mstep.m

📁 混合高斯模型 对于给定的数据
💻 M
字号:
function mixture1 = MStep(mixture, pixels)
% MStep     perform the M-step of the EM algorithm
%        from the pnk calculated in the E-step, update parameters of each cluster
%

   for k=1:mixture.K
      mixture.cluster(k).N = sum(mixture.pnk(:,k));
      mixture.cluster(k).pb = mixture.cluster(k).N;
      mixture.cluster(k).mu = (pixels' * mixture.pnk(:,k))/mixture.cluster(k).N;
      for r=1:mixture.M
         for s=r:mixture.M
            mixture.cluster(k).R(r,s) = ((pixels(:,r)-mixture.cluster(k).mu(r))' ...
                           * ((pixels(:,s)-mixture.cluster(k).mu(s)).*mixture.pnk(:,k))) ...
                           /mixture.cluster(k).N;
            if r~=s
               mixture.cluster(k).R(s,r) = mixture.cluster(k).R(r,s);
            end
         end
      end
      mixture.cluster(k).R = mixture.cluster(k).R+mixture.Rmin*eye(mixture.M);
   end
   mixture1=ClusterNormalize(mixture);
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -