docstr: refactored from line 166:
  https://github.com/DmZhukov/CrossTask/blob/master/train.py
docstr_tok: ["refactored","from","line","166",":","https",":","\/\/github.com\/DmZhukov\/CrossTask\/blob\/master\/train.py"]
code: def compute_metrics(self, outputs, targets, **kwargs):
      """refactored from line 166:
      https://github.com/DmZhukov/CrossTask/blob/master/train.py"""
  
      recalls = self._get_recalls(Y_true=targets, Y_pred=outputs)
      results = {}
      for task, rec in recalls.items():
          results[str(task)] = rec
  
      avg_recall = np.mean(list(recalls.values()))
      results["recall"] = avg_recall
      return results
  
imports: import numpy
  import json
label_desc: Use image node_id 2 for calling the CrossTaskMetric obj's underlying member method code with example usage: obj.compute_metrics(outputs, targets) and returns: results