class_docstr: Retrieve a downbeat activation function from a signal and pre-determined
  beat positions by obtaining beat-synchronous harmonic and percussive
  features which are processed with a GRU-RNN.
  
  Parameters
  ----------
  beat_subdivisions : tuple, optional
      Number of beat subdivisions for the percussive and harmonic feature.
  
  References
  ----------
  .. [1] Florian Krebs, Sebastian Böck and Gerhard Widmer,
         "Downbeat Tracking Using Beat-Synchronous Features and Recurrent
         Networks",
         Proceedings of the 17th International Society for Music Information
         Retrieval Conference (ISMIR), 2016.
  
  Examples
  --------
  Create an RNNBarProcessor and pass an audio file and pre-determined (or
  given) beat positions through the processor. The returned tuple contains
  the beats positions and the probability to be a downbeat.
  
  >>> proc = RNNBarProcessor()
  >>> proc  # doctest: +ELLIPSIS
  <madmom.features.downbeats.RNNBarProcessor object at 0x...>
  >>> beats = np.loadtxt('tests/data/detections/sample.dbn_beat_tracker.txt')
  >>> downbeat_prob = proc(('tests/data/audio/sample.wav', beats))
  >>> np.around(downbeat_prob, decimals=3)
  ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS +NORMALIZE_ARRAYS
  array([[0.1  , 0.378],
         [0.45 , 0.19 ],
         [0.8  , 0.112],
         [1.12 , 0.328],
         [1.48 , 0.27 ],
         [1.8  , 0.181],
         [2.15 , 0.162],
         [2.49 ,   nan]])
class_docstr_tok: ["Retrieve","a","downbeat","activation","function","from","a","signal","and","pre-determined","beat","positions","by","obtaining","beat-synchronous","harmonic","and","percussive","features","which","are","processed","with","a","GRU-RNN",".","Parameters","--","--","--","--","--","beat_subdivisions",":","tuple",",","optional","Number","of","beat","subdivisions","for","the","percussive","and","harmonic","feature",".","References","--","--","--","--","--","..","[","1","]","Florian","Krebs",",","Sebastian","B\u00f6ck","and","Gerhard","Widmer",",","``","Downbeat","Tracking","Using","Beat-Synchronous","Features","and","Recurrent","Networks","''",",","Proceedings","of","the","17th","International","Society","for","Music","Information","Retrieval","Conference","(","ISMIR",")",",","2016",".","Examples","--","--","--","--","Create","an","RNNBarProcessor","and","pass","an","audio","file","and","pre-determined","(","or","given",")","beat","positions","through","the","processor",".","The","returned","tuple","contains","the","beats","positions","and","the","probability","to","be","a","downbeat",".",">",">",">","proc","=","RNNBarProcessor","(",")",">",">",">","proc","#","doctest",":","+ELLIPSIS","<","madmom.features.downbeats.RNNBarProcessor","object","at","0x","...",">",">",">",">","beats","=","np.loadtxt","(","'tests\/data\/detections\/sample.dbn_beat_tracker.txt","'",")",">",">",">","downbeat_prob","=","proc","(","(","'tests\/data\/audio\/sample.wav","'",",","beats",")",")",">",">",">","np.around","(","downbeat_prob",",","decimals=3",")","...","#","doctest",":","+NORMALIZE_WHITESPACE","+ELLIPSIS","+NORMALIZE_ARRAYS","array","(","[","[","0.1",",","0.378","]",",","[","0.45",",","0.19","]",",","[","0.8",",","0.112","]",",","[","1.12",",","0.328","]",",","[","1.48",",","0.27","]",",","[","1.8",",","0.181","]",",","[","2.15",",","0.162","]",",","[","2.49",",","nan","]","]",")"]
docstr: Retrieve a downbeat activation function from a signal and beat
  positions.
  
  Parameters
  ----------
  data : tuple
      Tuple containing a signal or file (handle) and corresponding beat
      times [seconds].
  
  Returns
  -------
  numpy array, shape (num_beats, 2)
      Array containing the beat positions (first column) and the
      corresponding downbeat activations, i.e. the probability that a
      beat is a downbeat (second column).
  
  Notes
  -----
  Since features are synchronized to the beats, and the probability of
  being a downbeat depends on a whole beat duration, only num_beats-1
  activations can be computed and the last value is filled with 'NaN'.
code: def process(self, data, **kwargs):
      """
      Retrieve a downbeat activation function from a signal and beat
      positions.
  
      Parameters
      ----------
      data : tuple
          Tuple containing a signal or file (handle) and corresponding beat
          times [seconds].
  
      Returns
      -------
      numpy array, shape (num_beats, 2)
          Array containing the beat positions (first column) and the
          corresponding downbeat activations, i.e. the probability that a
          beat is a downbeat (second column).
  
      Notes
      -----
      Since features are synchronized to the beats, and the probability of
      being a downbeat depends on a whole beat duration, only num_beats-1
      activations can be computed and the last value is filled with 'NaN'.
  
      """
      # pylint: disable=unused-argument
      # split the input data
      signal, beats = data
      # process the signal
      perc = self.perc_feat(signal)
      harm = self.harm_feat(signal)
      # sync to the beats
      perc_synced = self.perc_beat_sync((perc, beats))
      harm_synced = self.harm_beat_sync((harm, beats))
      # process with NNs and average the predictions
      # Note: reshape the NN input to length of synced features
      perc = self.perc_nn(perc_synced.reshape((len(perc_synced), -1)))
      harm = self.harm_nn(harm_synced.reshape((len(harm_synced), -1)))
      # since the synchronized features contain 1 value less than the number
      # of beats, append an artificial value
      act = np.mean([perc, harm], axis=0)
      act = np.append(act, np.ones(1) * np.nan)
      return np.vstack((beats, act)).T
  
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 2 for calling the RNNBarProcessor obj's underlying member method code with example usage: obj.process(data) and returns: np