class_docstr: Computes heatmap accuracy for keypoint
  Parameters
  ----------
  axis : int, default=1
      The axis that represents classes
  name : str
      Name of this metric instance for display.
  output_names : list of str, or None
      Name of predictions that should be used when updating with update_dict.
      By default include all predictions.
  label_names : list of str, or None
      Name of labels that should be used when updating with update_dict.
      By default include all labels.
  ignore_labels : int or iterable of integers, optional
      If provided as not None, will ignore these labels during update.
  Examples
  --------
  >>> predicts = [mx.nd.array([[0.3, 0.7], [0, 1.], [0.4, 0.6]])]
  >>> labels   = [mx.nd.array([0, 1, 1])]
  >>> acc = mx.metric.Accuracy()
  >>> acc.update(preds = predicts, labels = labels)
  >>> print acc.get()
  ('accuracy', 0.6666666666666666)
class_docstr_tok: ["Computes","heatmap","accuracy","for","keypoint","Parameters","--","--","--","--","--","axis",":","int",",","default=1","The","axis","that","represents","classes","name",":","str","Name","of","this","metric","instance","for","display",".","output_names",":","list","of","str",",","or","None","Name","of","predictions","that","should","be","used","when","updating","with","update_dict",".","By","default","include","all","predictions",".","label_names",":","list","of","str",",","or","None","Name","of","labels","that","should","be","used","when","updating","with","update_dict",".","By","default","include","all","labels",".","ignore_labels",":","int","or","iterable","of","integers",",","optional","If","provided","as","not","None",",","will","ignore","these","labels","during","update",".","Examples","--","--","--","--",">",">",">","predicts","=","[","mx.nd.array","(","[","[","0.3",",","0.7","]",",","[","0",",","1",".","]",",","[","0.4",",","0.6","]","]",")","]",">",">",">","labels","=","[","mx.nd.array","(","[","0",",","1",",","1","]",")","]",">",">",">","acc","=","mx.metric.Accuracy","(",")",">",">",">","acc.update","(","preds","=","predicts",",","labels","=","labels",")",">",">",">","print","acc.get","(",")","(","'accuracy","'",",","0.6666666666666666",")"]
code: def _calc_dists(self, preds, target, normalize):
      preds = preds.astype(np.float32)
      target = target.astype(np.float32)
      dists = np.zeros((preds.shape[1], preds.shape[0]))
  
      for n in range(preds.shape[0]):
          for c in range(preds.shape[1]):
              if target[n, c, 0] > 1 and target[n, c, 1] > 1:
                  normed_preds = preds[n, c, :] / normalize[n]
                  normed_targets = target[n, c, :] / normalize[n]
                  dists[c, n] = np.linalg.norm(
                      normed_preds - normed_targets
                  )
              else:
                  dists[c, n] = -1
  
      return dists
  
imports: import numpy
label_desc: Use image node_id 2 for calling the HeatmapAccuracy obj's underlying member method code with example usage: obj._calc_dists(preds, target, normalize) and returns: dists