class_docstr: Bar tracking with a dynamic Bayesian network (DBN) approximated by a
  Hidden Markov Model (HMM).
  
  Parameters
  ----------
  beats_per_bar : int or list
      Number of beats per bar to be modeled. Can be either a single number
      or a list or array with bar lengths (in beats).
  observation_weight : int, optional
      Weight for the downbeat activations.
  meter_change_prob : float, optional
      Probability to change meter at bar boundaries.
  
  Examples
  --------
  Create a DBNBarTrackingProcessor. The returned array represents the
  positions of the beats and their position inside the bar. The position
  inside the bar follows the natural counting and starts at 1.
  
  The number of beats per bar which should be modelled must be given, all
  other parameters (e.g. probability to change the meter at bar boundaries)
  are optional but must have the same length as `beats_per_bar`.
  
  >>> proc = DBNBarTrackingProcessor(beats_per_bar=[3, 4])
  >>> proc  # doctest: +ELLIPSIS
  <madmom.features.downbeats.DBNBarTrackingProcessor object at 0x...>
  
  Call this DBNDownBeatTrackingProcessor with beat positions and downbeat
  activation function returned by RNNBarProcessor to obtain the positions.
  
  >>> beats = np.loadtxt('tests/data/detections/sample.dbn_beat_tracker.txt')
  >>> act = RNNBarProcessor()(('tests/data/audio/sample.wav', beats))
  >>> proc(act)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
  array([[0.1 , 1. ],
         [0.45, 2. ],
         [0.8 , 3. ],
         [1.12, 1. ],
         [1.48, 2. ],
         [1.8 , 3. ],
         [2.15, 1. ],
         [2.49, 2. ]])
class_docstr_tok: ["Bar","tracking","with","a","dynamic","Bayesian","network","(","DBN",")","approximated","by","a","Hidden","Markov","Model","(","HMM",")",".","Parameters","--","--","--","--","--","beats_per_bar",":","int","or","list","Number","of","beats","per","bar","to","be","modeled",".","Can","be","either","a","single","number","or","a","list","or","array","with","bar","lengths","(","in","beats",")",".","observation_weight",":","int",",","optional","Weight","for","the","downbeat","activations",".","meter_change_prob",":","float",",","optional","Probability","to","change","meter","at","bar","boundaries",".","Examples","--","--","--","--","Create","a","DBNBarTrackingProcessor",".","The","returned","array","represents","the","positions","of","the","beats","and","their","position","inside","the","bar",".","The","position","inside","the","bar","follows","the","natural","counting","and","starts","at","1",".","The","number","of","beats","per","bar","which","should","be","modelled","must","be","given",",","all","other","parameters","(","e.g",".","probability","to","change","the","meter","at","bar","boundaries",")","are","optional","but","must","have","the","same","length","as","`","beats_per_bar","`",".",">",">",">","proc","=","DBNBarTrackingProcessor","(","beats_per_bar=","[","3",",","4","]",")",">",">",">","proc","#","doctest",":","+ELLIPSIS","<","madmom.features.downbeats.DBNBarTrackingProcessor","object","at","0x","...",">","Call","this","DBNDownBeatTrackingProcessor","with","beat","positions","and","downbeat","activation","function","returned","by","RNNBarProcessor","to","obtain","the","positions",".",">",">",">","beats","=","np.loadtxt","(","'tests\/data\/detections\/sample.dbn_beat_tracker.txt","'",")",">",">",">","act","=","RNNBarProcessor","(",")","(","(","'tests\/data\/audio\/sample.wav","'",",","beats",")",")",">",">",">","proc","(","act",")","#","doctest",":","+ELLIPSIS","+NORMALIZE_WHITESPACE","array","(","[","[","0.1",",","1",".","]",",","[","0.45",",","2",".","]",",","[","0.8",",","3",".","]",",","[","1.12",",","1",".","]",",","[","1.48",",","2",".","]",",","[","1.8",",","3",".","]",",","[","2.15",",","1",".","]",",","[","2.49",",","2",".","]","]",")"]
code: def __init__(
      self,
      beats_per_bar=(3, 4),
      observation_weight=OBSERVATION_WEIGHT,
      meter_change_prob=METER_CHANGE_PROB,
      **kwargs,
  ):
      # pylint: disable=unused-argument
      from madmom.utils import integer_types
  
      if isinstance(beats_per_bar, integer_types):
          beats_per_bar = (beats_per_bar,)
      self.beats_per_bar = beats_per_bar
      # state space & transition model for each bar length
      state_spaces = []
      transition_models = []
      for beats in self.beats_per_bar:
          # Note: tempo and transition_lambda is not relevant
          st = BarStateSpace(beats, min_interval=1, max_interval=1)
          tm = BarTransitionModel(st, transition_lambda=1)
          state_spaces.append(st)
          transition_models.append(tm)
      # Note: treat different bar lengths as different patterns and use the
      #       existing MultiPatternStateSpace and MultiPatternTransitionModel
      self.st = MultiPatternStateSpace(state_spaces)
      self.tm = MultiPatternTransitionModel(
          transition_models, transition_prob=meter_change_prob
      )
      # observation model
      self.om = RNNBeatTrackingObservationModel(
          self.st, observation_weight
      )
      # instantiate a HMM
      self.hmm = HiddenMarkovModel(self.tm, self.om, None)
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  import warnings
  import numpy
  from .beats import threshold_activations
  from .beats_hmm import BarStateSpace, BarTransitionModel, GMMPatternTrackingObservationModel, MultiPatternStateSpace, MultiPatternTransitionModel, RNNBeatTrackingObservationModel, RNNDownBeatTrackingObservationModel
  from ..ml.hmm import HiddenMarkovModel
  from ..processors import ParallelProcessor, Processor, SequentialProcessor
  from ..utils import string_types
label_desc: Use image node_id 1 to create a new DBNBarTrackingProcessor object from inherited base classes: Processor with example: obj = DBNBarTrackingProcessor(beats_per_bar, observation_weight, meter_change_prob)