class_docstr: Smooth the inference results by using average window.
  
  Maintain a slide window over the audio stream, which adds new result(a pair of
  the 1.confidences of all classes and 2.the start timestamp of input audio
  clip) directly the inference produces one and removes the most previous one
  and other abnormal values. Then it smooth the results in the window to get
  the most reliable command in this period.
  
  Attributes:
    _label: A list containing commands at corresponding lines.
    _average_window_duration: The length of average window.
    _detection_threshold: A confidence threshold for filtering out unreliable
      command.
    _suppression_ms: Milliseconds every two reliable founded commands should
      apart.
    _minimum_count: An integer count indicating the minimum results the average
      window should cover.
    _previous_results: A deque to store previous results.
    _label_count: The length of label list.
    _previous_top_label: Last founded command. Initial value is '_silence_'.
    _previous_top_time: The timestamp of _previous results. Default is -np.inf.
class_docstr_tok: ["Smooth","the","inference","results","by","using","average","window",".","Maintain","a","slide","window","over","the","audio","stream",",","which","adds","new","result","(","a","pair","of","the","1.confidences","of","all","classes","and","2.the","start","timestamp","of","input","audio","clip",")","directly","the","inference","produces","one","and","removes","the","most","previous","one","and","other","abnormal","values",".","Then","it","smooth","the","results","in","the","window","to","get","the","most","reliable","command","in","this","period",".","Attributes",":","_label",":","A","list","containing","commands","at","corresponding","lines",".","_average_window_duration",":","The","length","of","average","window",".","_detection_threshold",":","A","confidence","threshold","for","filtering","out","unreliable","command",".","_suppression_ms",":","Milliseconds","every","two","reliable","founded","commands","should","apart",".","_minimum_count",":","An","integer","count","indicating","the","minimum","results","the","average","window","should","cover",".","_previous_results",":","A","deque","to","store","previous","results",".","_label_count",":","The","length","of","label","list",".","_previous_top_label",":","Last","founded","command",".","Initial","value","is","'_silence_","'",".","_previous_top_time",":","The","timestamp","of","_previous","results",".","Default","is","-np.inf","."]
docstr: Init the RecognizeCommands with parameters used for smoothing.
docstr_tok: ["Init","the","RecognizeCommands","with","parameters","used","for","smoothing","."]
code: def __init__(
      self,
      labels,
      average_window_duration_ms,
      detection_threshold,
      suppression_ms,
      minimum_count,
  ):
      """Init the RecognizeCommands with parameters used for smoothing."""
      # Configuration
      self._labels = labels
      self._average_window_duration_ms = average_window_duration_ms
      self._detection_threshold = detection_threshold
      self._suppression_ms = suppression_ms
      self._minimum_count = minimum_count
      # Working Variable
      self._previous_results = collections.deque()
      self._label_count = len(labels)
      self._previous_top_label = "_silence_"
      self._previous_top_time = -np.inf
  
file_path: tensorflow/tensorflow/examples/speech_commands/recognize_commands.py
imports: import collections
  import numpy
label_desc: Use image node_id 1 to create a new RecognizeCommands object from inherited base classes: object with example: obj = RecognizeCommands(labels, average_window_duration_ms, detection_threshold, suppression_ms, minimum_count)