def _EM_VMM_GMM_maximisation_step(self):
'''Maximisation step SH : 7June2013
'''
self.pi_hat = np.sum(self.zij,axis=0)/float(self.n_instances)
self.mu_list_old = self.mu_list.copy()
self.kappa_list_old = self.kappa_list.copy()
self.mean_list_old = self.mean_list.copy()
self.std_list_old = self.std_list.copy()
for cluster_ident in range(self.n_clusters):
inst_tmp = (self.instance_array_complex.T * self.zij[:,cluster_ident]).T
N= np.sum(self.zij[:,cluster_ident])
#calculate the best fit for this cluster - all dimensions at once.... using new approximations
#VMM part
self.kappa_list[cluster_ident,:], self.mu_list[cluster_ident,:], scale_fit1 = EM_VMM_calc_best_fit(inst_tmp, lookup=self.bessel_lookup_table, N=N)
#GMM part
self.std_list[cluster_ident,:], self.mean_list[cluster_ident,:] = EM_GMM_calc_best_fit(self.instance_array_amps, self.zij[:,cluster_ident])
#Prevent ridiculous situations happening....
self.kappa_list = np.clip(self.kappa_list,0.1,300)
self.std_list = np.clip(self.std_list,0.001,300)
self._EM_VMM_GMM_check_convergence()
评论列表
文章目录