(shots, logits, targets)
return shot_to_precision
Performance of a particular class as a function of its 'shot'.

  Args:
    shots: A list containing a np.array per episode. The shape of an episode's
      array is the [way]. Stores the 'shot' of each class, ie. the number of
      training examples that that class has in the support set.
    logits: A list containing a np.array per episode. The shape of an episode's
      array is [size of test set, way].
    targets: A list containing a np.array per episode. The shape of an episode's
      array is [size of test set]. This contains integers in the range from 0 to
      the way of the episode.

  Returns:
    shot_to_precision: A dict that maps each 'observed' shot to a list that
      stores the precision obtained for that shot (each entry in this list is
      the precision of a particular class that had this shot, regardless of the
      shots of the other classes in the episode.).
Performance of a particular class as a function of its 'shot'.
Performance of a particular class as a function of its shot .
def get_shot_to_precision(shots, logits, targets):
  """Performance of a particular class as a function of its 'shot'.

  Args:
    shots: A list containing a np.array per episode. The shape of an episode's
      array is the [way]. Stores the 'shot' of each class, ie. the number of
      training examples that that class has in the support set.
    logits: A list containing a np.array per episode. The shape of an episode's
      array is [size of test set, way].
    targets: A list containing a np.array per episode. The shape of an episode's
      array is [size of test set]. This contains integers in the range from 0 to
      the way of the episode.

  Returns:
    shot_to_precision: A dict that maps each 'observed' shot to a list that
      stores the precision obtained for that shot (each entry in this list is
      the precision of a particular class that had this shot, regardless of the
      shots of the other classes in the episode.).
  """
  shot_to_precision = collections.defaultdict(list)
  for episode_num, episode_shots in enumerate(shots):
    episode_logits = logits[episode_num]
    episode_targets = targets[episode_num]
    for class_id, class_shot in enumerate(episode_shots):
      class_precision = compute_class_precision(class_id, episode_logits,
                                                episode_targets)
      shot_to_precision[class_shot].append(class_precision)
  return shot_to_precision
def get_shot_to_precision ( shots , logits , targets ) : shot_to_precision = collections . defaultdict ( list ) for episode_num , episode_shots in enumerate ( shots ) : episode_logits = logits [ episode_num ] episode_targets = targets [ episode_num ] for class_id , class_shot in enumerate ( episode_shots ) : class_precision = compute_class_precision ( class_id , episode_logits , episode_targets ) shot_to_precision [ class_shot ] . append ( class_precision ) return shot_to_precision