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",".","]","]",")"]
docstr: Add DBN related arguments to an existing parser.
  
  Parameters
  ----------
  parser : argparse parser instance
      Existing argparse parser object.
  beats_per_bar : int or list, optional
      Number of beats per bar to be modeled. Can be either a single
      number or a list with bar lengths (in beats).
  observation_weight : float, optional
      Weight for the activations at downbeat times.
  meter_change_prob : float, optional
      Probability to change meter at bar boundaries.
  
  Returns
  -------
  parser_group : argparse argument group
      DBN bar tracking argument parser group
code: def add_arguments(
      cls,
      parser,
      beats_per_bar,
      observation_weight=OBSERVATION_WEIGHT,
      meter_change_prob=METER_CHANGE_PROB,
  ):
      """
      Add DBN related arguments to an existing parser.
  
      Parameters
      ----------
      parser : argparse parser instance
          Existing argparse parser object.
      beats_per_bar : int or list, optional
          Number of beats per bar to be modeled. Can be either a single
          number or a list with bar lengths (in beats).
      observation_weight : float, optional
          Weight for the activations at downbeat times.
      meter_change_prob : float, optional
          Probability to change meter at bar boundaries.
  
      Returns
      -------
      parser_group : argparse argument group
          DBN bar tracking argument parser group
  
      """
      # pylint: disable=arguments-differ
      from ..utils import OverrideDefaultListAction
  
      # add DBN parser group
      g = parser.add_argument_group(
          "dynamic Bayesian Network arguments"
      )
      g.add_argument(
          "--beats_per_bar",
          action=OverrideDefaultListAction,
          default=beats_per_bar,
          type=int,
          sep=",",
          help="number of beats per bar to be modeled (comma "
          "separated list of bar length in beats) "
          "[default=%(default)s]",
      )
      g.add_argument(
          "--observation_weight",
          action="store",
          type=float,
          default=observation_weight,
          help="weight for the downbeat activations "
          "[default=%(default)i]",
      )
      g.add_argument(
          "--meter_change_prob",
          action="store",
          type=float,
          default=meter_change_prob,
          help="meter change probability [default=%(default).g]",
      )
      # add output format stuff
      parser = parser.add_argument_group("output arguments")
      parser.add_argument(
          "--downbeats",
          action="store_true",
          default=False,
          help="output only the downbeats",
      )
      # return the argument group so it can be modified if needed
      return parser
  
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 3 for calling the DBNBarTrackingProcessor obj's underlying member method code with example usage: obj.add_arguments(cls, parser, beats_per_bar, observation_weight, meter_change_prob) and returns: parser