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","."]
code: def __init__(self, pattern_files, state_space):
      # save the parameters
      self.pattern_files = pattern_files
      self.state_space = state_space
      # define the pointers of the log densities
      pointers = np.zeros(state_space.num_states, dtype=np.uint32)
      patterns = self.state_space.state_patterns
      positions = self.state_space.state_positions
      # Note: the densities of all GMMs are just stacked on top of each
      #       other, so we have to to keep track of the total number of GMMs
      densities_idx_offset = 0
      for p, gmms in enumerate(pattern_files):
          # number of fitted GMMs for this pattern
          num_gmms = len(gmms)
          # number of beats in this pattern
          # TODO: save the number of beats in the pattern files so we don't
          #       need to save references to all state spaces
          num_beats = self.state_space.state_spaces[p].num_beats
          # distribute the observation densities defined by the GMMs
          # uniformly across the entire state space (for this pattern)
          # since the densities are just stacked, add the offset
          # Note: we have to divide by the number of beats, since the
          #       positions range is [0, num_beats]
          pointers[patterns == p] = (
              positions[patterns == p] * num_gmms / num_beats
              + densities_idx_offset
          )
          # increase the offset by the number of GMMs
          densities_idx_offset += num_gmms
      # instantiate a ObservationModel with the pointers
      super(GMMPatternTrackingObservationModel, self).__init__(pointers)
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from madmom.ml.hmm import ObservationModel, TransitionModel
label_desc: Use image node_id 1 to create a new GMMPatternTrackingObservationModel object from inherited base classes: ObservationModel with example: obj = GMMPatternTrackingObservationModel(pattern_files, state_space)