class_docstr: Evaluates F0s created with TWM heuristic.
class_docstr_tok: ["Evaluates","F0s","created","with","TWM","heuristic","."]
docstr: Computes F0 from sinusoids using TWM heuristic.
docstr_tok: ["Computes","F0","from","sinusoids","using","TWM","heuristic","."]
code: def _compute_twm_f0(self, outputs):
      """Computes F0 from sinusoids using TWM heuristic."""
      processor_controls = outputs[self._processor_name]["controls"]
      freqs = processor_controls["frequencies"]
      amps = processor_controls["amplitudes"]
      if self._noisy:
          noise_ratios = processor_controls["noise_ratios"]
          amps = amps * (1.0 - noise_ratios)
      twm = ddsp.losses.TWMLoss()
      # Treat all freqs as candidate f0s.
      return twm.predict_f0(freqs, freqs, amps)
  
imports: import ddsp
  from ddsp.training import heuristics
  from ddsp.training import metrics
  from ddsp.training import summaries
  import gin
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 2 for calling the TWMEvaluator obj's underlying member method code with example usage: obj._compute_twm_f0(outputs) and returns: twm