class_docstr: Conditional Random Field Beat Detection.
  
  Tracks the beats according to the previously determined global tempo using
  a conditional random field (CRF) model.
  
  Parameters
  ----------
  interval_sigma : float, optional
      Allowed deviation from the dominant beat interval per beat.
  use_factors : bool, optional
      Use dominant interval multiplied by factors instead of intervals
      estimated by tempo estimator.
  num_intervals : int, optional
      Maximum number of estimated intervals to try.
  factors : list or numpy array, optional
      Factors of the dominant interval to try.
  
  References
  ----------
  .. [1] Filip Korzeniowski, Sebastian Böck and Gerhard Widmer,
         "Probabilistic Extraction of Beat Positions from a Beat Activation
         Function",
         Proceedings of the 15th International Society for Music Information
         Retrieval Conference (ISMIR), 2014.
  
  Examples
  --------
  Create a CRFBeatDetectionProcessor. The returned array represents the
  positions of the beats in seconds, thus the expected sampling rate has to
  be given.
  
  >>> proc = CRFBeatDetectionProcessor(fps=100)
  >>> proc  # doctest: +ELLIPSIS
  <madmom.features.beats.CRFBeatDetectionProcessor object at 0x...>
  
  Call this BeatDetectionProcessor with the beat activation function returned
  by RNNBeatProcessor to obtain the beat positions.
  
  >>> act = RNNBeatProcessor()('tests/data/audio/sample.wav')
  >>> proc(act)
  array([0.09, 0.79, 1.49])
class_docstr_tok: ["Conditional","Random","Field","Beat","Detection",".","Tracks","the","beats","according","to","the","previously","determined","global","tempo","using","a","conditional","random","field","(","CRF",")","model",".","Parameters","--","--","--","--","--","interval_sigma",":","float",",","optional","Allowed","deviation","from","the","dominant","beat","interval","per","beat",".","use_factors",":","bool",",","optional","Use","dominant","interval","multiplied","by","factors","instead","of","intervals","estimated","by","tempo","estimator",".","num_intervals",":","int",",","optional","Maximum","number","of","estimated","intervals","to","try",".","factors",":","list","or","numpy","array",",","optional","Factors","of","the","dominant","interval","to","try",".","References","--","--","--","--","--","..","[","1","]","Filip","Korzeniowski",",","Sebastian","B\u00f6ck","and","Gerhard","Widmer",",","``","Probabilistic","Extraction","of","Beat","Positions","from","a","Beat","Activation","Function","''",",","Proceedings","of","the","15th","International","Society","for","Music","Information","Retrieval","Conference","(","ISMIR",")",",","2014",".","Examples","--","--","--","--","Create","a","CRFBeatDetectionProcessor",".","The","returned","array","represents","the","positions","of","the","beats","in","seconds",",","thus","the","expected","sampling","rate","has","to","be","given",".",">",">",">","proc","=","CRFBeatDetectionProcessor","(","fps=100",")",">",">",">","proc","#","doctest",":","+ELLIPSIS","<","madmom.features.beats.CRFBeatDetectionProcessor","object","at","0x","...",">","Call","this","BeatDetectionProcessor","with","the","beat","activation","function","returned","by","RNNBeatProcessor","to","obtain","the","beat","positions",".",">",">",">","act","=","RNNBeatProcessor","(",")","(","'tests\/data\/audio\/sample.wav","'",")",">",">",">","proc","(","act",")","array","(","[","0.09",",","0.79",",","1.49","]",")"]
docstr: Detect the beats in the given activation function.
  
  Parameters
  ----------
  activations : numpy array
      Beat activation function.
  
  Returns
  -------
  numpy array
      Detected beat positions [seconds].
docstr_tok: ["Detect","the","beats","in","the","given","activation","function",".","Parameters","--","--","--","--","--","activations",":","numpy","array","Beat","activation","function",".","Returns","--","--","--","-","numpy","array","Detected","beat","positions","[","seconds","]","."]
code: def process(self, activations, **kwargs):
      """
      Detect the beats in the given activation function.
  
      Parameters
      ----------
      activations : numpy array
          Beat activation function.
  
      Returns
      -------
      numpy array
          Detected beat positions [seconds].
  
      """
      import itertools as it
  
      # estimate the tempo
      tempi = self.tempo_estimator.process(activations)
      intervals = self.fps * 60.0 / tempi[:, 0]
  
      # compute possible intervals
      if self.use_factors:
          # use the dominant interval with different factors
          possible_intervals = [
              int(intervals[0] * f) for f in self.factors
          ]
          possible_intervals = [
              i
              for i in possible_intervals
              if self.tempo_estimator.max_interval
              >= i
              >= self.tempo_estimator.min_interval
          ]
      else:
          # take the top n intervals from the tempo estimator
          possible_intervals = intervals[: self.num_intervals]
  
      # sort and start from the greatest interval
      possible_intervals.sort()
      possible_intervals = [int(i) for i in possible_intervals[::-1]]
  
      # smooth activations
      act_smooth = int(self.fps * self.tempo_estimator.act_smooth)
      activations = smooth_signal(activations, act_smooth)
  
      # since the cython code uses memory views, we need to make sure that
      # the activations are C-contiguous and of C-type float (np.float32)
      contiguous_act = np.ascontiguousarray(
          activations, dtype=np.float32
      )
      results = list(
          self.map(
              _process_crf,
              zip(
                  it.repeat(contiguous_act),
                  possible_intervals,
                  it.repeat(self.interval_sigma),
              ),
          )
      )
  
      # normalize their probabilities
      normalized_seq_probabilities = np.array(
          [r[1] / r[0].shape[0] for r in results]
      )
      # pick the best one
      best_seq = results[normalized_seq_probabilities.argmax()][0]
  
      # convert the detected beat positions to seconds and return them
      return best_seq.astype(float) / self.fps
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  import numpy
  from ..audio.signal import signal_frame, smooth
  from ..ml.nn import average_predictions
  from ..processors import OnlineProcessor, ParallelProcessor, Processor, SequentialProcessor
label_desc: Use image node_id 2 for calling the CRFBeatDetectionProcessor obj's underlying member method code with example usage: obj.process(activations) and returns: unknown