def _covar_mstep_full(gmm, X, responsibilities, weighted_X_sum, norm, min_covar):
 n_features = X.shape[1]
 cv = np.empty((gmm.n_components, n_features, n_features))
 for c in range(gmm.n_components):
  post = responsibilities[:, c]
  mu = gmm.means_[c]
  diff = (X - mu)
  with np.errstate(under='ignore'):
   avg_cv = (np.dot((post * diff.T), diff) / (post.sum() + (10 * EPS)))
  cv[c] = (avg_cv + (min_covar * np.eye(n_features)))
 return cv

def _covar_mstep_full ( gmm , X , responsibilities , weighted_X_sum , norm , min_covar ) : n_features = X . shape [ 1 ] cv = np . empty ( ( gmm . n_components , n_features , n_features ) ) for c in range ( gmm . n_components ) : post = responsibilities [ : , c ] mu = gmm . means_ [ c ] diff = ( X - mu ) with np . errstate ( under = 'ignore' ) : avg_cv = ( np . dot ( ( post * diff . T ) , diff ) / ( post . sum ( ) + ( 10 * EPS ) ) ) cv [ c ] = ( avg_cv + ( min_covar * np . eye ( n_features ) ) ) return cv
perform the covariance m step for full cases .