docstr: refactored from
  https://github.com/DmZhukov/CrossTask/blob/master/train.py
docstr_tok: ["refactored","from","https",":","\/\/github.com\/DmZhukov\/CrossTask\/blob\/master\/train.py"]
code: def _get_recalls(self, Y_true, Y_pred):
      """refactored from
      https://github.com/DmZhukov/CrossTask/blob/master/train.py"""
  
      step_match = {task: 0 for task in Y_true.keys()}
      step_total = {task: 0 for task in Y_true.keys()}
      for task, ys_true in Y_true.items():
          ys_pred = Y_pred[task]
          for vid in set(ys_pred.keys()).intersection(
              set(ys_true.keys())
          ):
              y_true = ys_true[vid]
              y_pred = ys_pred[vid]
              step_total[task] += (y_true.sum(axis=0) > 0).sum()
              step_match[task] += (y_true * y_pred).sum()
      recalls = {
          task: step_match[task] / n for task, n in step_total.items()
      }
      return recalls
  
imports: import numpy
  import json
label_desc: Use image node_id 4 for calling the CrossTaskMetric obj's underlying member method code with example usage: obj._get_recalls(Y_true, Y_pred) and returns: recalls