class_docstr: Gaussian Mixture Model
  
  Representation of a Gaussian mixture model probability distribution.
  This class allows for easy evaluation of, sampling from, and
  maximum-likelihood estimation of the parameters of a GMM distribution.
  
  Initializes parameters such that every mixture component has zero
  mean and identity covariance.
  
  Parameters
  ----------
  n_components : int, optional
      Number of mixture components. Defaults to 1.
  covariance_type : {'diag', 'spherical', 'tied', 'full'}
      String describing the type of covariance parameters to
      use. Defaults to 'diag'.
  
  Attributes
  ----------
  `weights_` : array, shape (n_components,)
      This attribute stores the mixing weights for each mixture component.
  `means_` : array, shape (n_components, n_features)
      Mean parameters for each mixture component.
  `covars_` : array
      Covariance parameters for each mixture component. The shape
      depends on `covariance_type`.::
  
      - (n_components, n_features)             if 'spherical',
      - (n_features, n_features)               if 'tied',
      - (n_components, n_features)             if 'diag',
      - (n_components, n_features, n_features) if 'full'.
  
  `converged_` : bool
      True when convergence was reached in fit(), False otherwise.
  
  See Also
  --------
  sklearn.mixture.GMM
class_docstr_tok: ["Gaussian","Mixture","Model","Representation","of","a","Gaussian","mixture","model","probability","distribution",".","This","class","allows","for","easy","evaluation","of",",","sampling","from",",","and","maximum-likelihood","estimation","of","the","parameters","of","a","GMM","distribution",".","Initializes","parameters","such","that","every","mixture","component","has","zero","mean","and","identity","covariance",".","Parameters","--","--","--","--","--","n_components",":","int",",","optional","Number","of","mixture","components",".","Defaults","to","1.","covariance_type",":","{","'diag","'",",","'spherical","'",",","'tied","'",",","'full","'","}","String","describing","the","type","of","covariance","parameters","to","use",".","Defaults","to","'diag","'",".","Attributes","--","--","--","--","--","`","weights_","`",":","array",",","shape","(","n_components",",",")","This","attribute","stores","the","mixing","weights","for","each","mixture","component",".","`","means_","`",":","array",",","shape","(","n_components",",","n_features",")","Mean","parameters","for","each","mixture","component",".","`","covars_","`",":","array","Covariance","parameters","for","each","mixture","component",".","The","shape","depends","on","`","covariance_type","`",".",":",":","-","(","n_components",",","n_features",")","if","'spherical","'",",","-","(","n_features",",","n_features",")","if","'tied","'",",","-","(","n_components",",","n_features",")","if","'diag","'",",","-","(","n_components",",","n_features",",","n_features",")","if","'full","'",".","`","converged_","`",":","bool","True","when","convergence","was","reached","in","fit","(",")",",","False","otherwise",".","See","Also","--","--","--","--","sklearn.mixture.GMM"]
docstr: Return the per-sample likelihood of the data under the model.
  
  Compute the log probability of x under the model and
  return the posterior distribution (responsibilities) of each
  mixture component for each element of x.
  
  Parameters
  ----------
  x: array_like, shape (n_samples, n_features)
      List of n_features-dimensional data points. Each row corresponds
      to a single data point.
  
  Returns
  -------
  log_prob : array_like, shape (n_samples,)
      Log probabilities of each data point in `x`.
  
  responsibilities : array_like, shape (n_samples, n_components)
      Posterior probabilities of each mixture component for each
      observation.
docstr_tok: ["Return","the","per-sample","likelihood","of","the","data","under","the","model",".","Compute","the","log","probability","of","x","under","the","model","and","return","the","posterior","distribution","(","responsibilities",")","of","each","mixture","component","for","each","element","of","x.","Parameters","--","--","--","--","--","x",":","array_like",",","shape","(","n_samples",",","n_features",")","List","of","n_features-dimensional","data","points",".","Each","row","corresponds","to","a","single","data","point",".","Returns","--","--","--","-","log_prob",":","array_like",",","shape","(","n_samples",",",")","Log","probabilities","of","each","data","point","in","`","x","`",".","responsibilities",":","array_like",",","shape","(","n_samples",",","n_components",")","Posterior","probabilities","of","each","mixture","component","for","each","observation","."]
code: def score_samples(self, x):
      """
      Return the per-sample likelihood of the data under the model.
  
      Compute the log probability of x under the model and
      return the posterior distribution (responsibilities) of each
      mixture component for each element of x.
  
      Parameters
      ----------
      x: array_like, shape (n_samples, n_features)
          List of n_features-dimensional data points. Each row corresponds
          to a single data point.
  
      Returns
      -------
      log_prob : array_like, shape (n_samples,)
          Log probabilities of each data point in `x`.
  
      responsibilities : array_like, shape (n_samples, n_components)
          Posterior probabilities of each mixture component for each
          observation.
  
      """
      x = np.asarray(x)
      if x.ndim == 1:
          x = x[:, np.newaxis]
      if x.size == 0:
          return np.array([]), np.empty((0, self.n_components))
      if x.shape[1] != self.means.shape[1]:
          raise ValueError("The shape of x is not compatible with self")
  
      lpr = log_multivariate_normal_density(
          x, self.means, self.covars, self.covariance_type
      ) + np.log(self.weights)
      log_prob = logsumexp(lpr, axis=1)
      responsibilities = np.exp(lpr - log_prob[:, np.newaxis])
      return log_prob, responsibilities
  
file_path: madmom/madmom/ml/gmm.py
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from scipy import linalg
label_desc: Use image node_id 3 for calling the GMM obj's underlying member method code with example usage: obj.score_samples(x) and returns: log_prob,  responsibilities, np,  np