class_docstr: Evaluator used for global metrics evaluation.
class_docstr_tok: ["Evaluator","used","for","global","metrics","evaluation","."]
docstr: Computes the relevant metrics for all added <target, output> pairs.
docstr_tok: ["Computes","the","relevant","metrics","for","all","added","<","target",",","output",">","pairs","."]
code: def compute_metrics(
      self, clear_annotations: Optional[bool] = True
  ) -> Dict[str, float]:
      """Computes the relevant metrics for all added <target, output> pairs."""
      metrics = {}
      if "truvari_recall_events" in self.global_metrics:
          metrics.update(
              truvari_recall_events(
                  one_hot_targets=self.batches[0],
                  logits=self.batches[1],
              )
          )
      if "truvari_precision_events" in self.global_metrics:
          metrics.update(
              truvari_precision_events(
                  one_hot_targets=self.batches[0],
                  logits=self.batches[1],
              )
          )
      if "truvari_recall" in self.global_metrics:
          metrics.update(
              truvari_recall(
                  one_hot_targets=self.batches[0],
                  logits=self.batches[1],
              )
          )
      if "truvari_precision" in self.global_metrics:
          metrics.update(
              truvari_precision(
                  one_hot_targets=self.batches[0],
                  logits=self.batches[1],
              )
          )
      if "gt_concordance" in self.global_metrics:
          metrics.update(
              gt_concordance(
                  one_hot_targets=self.batches[0],
                  logits=self.batches[1],
              )
          )
      if "nonref_concordance" in self.global_metrics:
          metrics.update(
              nonref_concordance(
                  one_hot_targets=self.batches[0],
                  logits=self.batches[1],
              )
          )
  
      if clear_annotations:
          self.clear()
      return metrics
  
file_path: scenic/scenic/projects/svvit/metrics.py
imports: from typing import Optional, List, Dict
  import numpy
label_desc: Use image node_id 3 for calling the TruvariGlobalEvaluator obj's underlying member method code with example usage: obj.compute_metrics(clear_annotations) and returns: metrics