class_docstr: Observation model for GMM based beat tracking with a HMM.
  
  Parameters
  ----------
  pattern_files : list
      List with files representing the rhythmic patterns, one entry per
      pattern; each pattern being a list with fitted GMMs.
  state_space : :class:`MultiPatternStateSpace` instance
      Multi pattern state space.
  
  References
  ----------
  .. [1] Florian Krebs, Sebastian Böck and Gerhard Widmer,
         "Rhythmic Pattern Modeling for Beat and Downbeat Tracking in Musical
         Audio",
         Proceedings of the 14th International Society for Music Information
         Retrieval Conference (ISMIR), 2013.
class_docstr_tok: ["Observation","model","for","GMM","based","beat","tracking","with","a","HMM",".","Parameters","--","--","--","--","--","pattern_files",":","list","List","with","files","representing","the","rhythmic","patterns",",","one","entry","per","pattern",";","each","pattern","being","a","list","with","fitted","GMMs",".","state_space",":",":","class",":","`","MultiPatternStateSpace","`","instance","Multi","pattern","state","space",".","References","--","--","--","--","--","..","[","1","]","Florian","Krebs",",","Sebastian","B\u00f6ck","and","Gerhard","Widmer",",","``","Rhythmic","Pattern","Modeling","for","Beat","and","Downbeat","Tracking","in","Musical","Audio","''",",","Proceedings","of","the","14th","International","Society","for","Music","Information","Retrieval","Conference","(","ISMIR",")",",","2013","."]
docstr: Compute the log densities of the observations using (a) GMM(s).
  
  Parameters
  ----------
  observations : numpy array
      Observations (i.e. multi-band spectral flux features).
  
  Returns
  -------
  numpy array, shape (N, num_gmms)
      Log densities of the observations, the columns represent the
      observation log probability densities for the individual GMMs.
docstr_tok: ["Compute","the","log","densities","of","the","observations","using","(","a",")","GMM","(","s",")",".","Parameters","--","--","--","--","--","observations",":","numpy","array","Observations","(","i.e",".","multi-band","spectral","flux","features",")",".","Returns","--","--","--","-","numpy","array",",","shape","(","N",",","num_gmms",")","Log","densities","of","the","observations",",","the","columns","represent","the","observation","log","probability","densities","for","the","individual","GMMs","."]
code: def log_densities(self, observations):
      """
      Compute the log densities of the observations using (a) GMM(s).
  
      Parameters
      ----------
      observations : numpy array
          Observations (i.e. multi-band spectral flux features).
  
      Returns
      -------
      numpy array, shape (N, num_gmms)
          Log densities of the observations, the columns represent the
          observation log probability densities for the individual GMMs.
  
      """
      # number of GMMs of all patterns
      num_gmms = sum([len(pattern) for pattern in self.pattern_files])
      # init the densities
      log_densities = np.empty(
          (len(observations), num_gmms), dtype=float
      )
      # define the observation densities
      i = 0
      for pattern in self.pattern_files:
          for gmm in pattern:
              # get the predictions of each GMM for the observations
              log_densities[:, i] = gmm.score(observations)
              i += 1
      # return the densities
      return log_densities
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from madmom.ml.hmm import ObservationModel, TransitionModel
label_desc: Use image node_id 2 for calling the GMMPatternTrackingObservationModel obj's underlying member method code with example usage: obj.log_densities(observations) and returns: log_densities