class_docstr: The APMeter measures the average precision per class.
  The APMeter is designed to operate on `NxK` Tensors `output` and
  `target`, and optionally a `Nx1` Tensor weight where (1) the `output`
  contains model output scores for `N` examples and `K` classes that ought to
  be higher when the model is more convinced that the example should be
  positively labeled, and smaller when the model believes the example should
  be negatively labeled (for instance, the output of a sigmoid function); (2)
  the `target` contains only values 0 (for negative examples) and 1
  (for positive examples); and (3) the `weight` ( > 0) represents weight for
  each sample.
class_docstr_tok: ["The","APMeter","measures","the","average","precision","per","class",".","The","APMeter","is","designed","to","operate","on","`","NxK","`","Tensors","`","output","`","and","`","target","`",",","and","optionally","a","`","Nx1","`","Tensor","weight","where","(","1",")","the","`","output","`","contains","model","output","scores","for","`","N","`","examples","and","`","K","`","classes","that","ought","to","be","higher","when","the","model","is","more","convinced","that","the","example","should","be","positively","labeled",",","and","smaller","when","the","model","believes","the","example","should","be","negatively","labeled","(","for","instance",",","the","output","of","a","sigmoid","function",")",";","(","2",")","the","`","target","`","contains","only","values","0","(","for","negative","examples",")","and","1","(","for","positive","examples",")",";","and","(","3",")","the","`","weight","`","(",">","0",")","represents","weight","for","each","sample","."]
code: def __init__(self, difficult_examples=False):
      super(AveragePrecisionMeter, self).__init__()
      self.reset()
      self.difficult_examples = difficult_examples
  
file_path: pretrained-models.pytorch/pretrainedmodels/datasets/utils.py
imports: from __future__ import print_function, division, absolute_import
  import math
  from six.moves.urllib.request import urlretrieve
  import torch
  from PIL import Image
  from tqdm import tqdm
label_desc: Use image node_id 1 to create a new AveragePrecisionMeter object from inherited base classes: object with example: obj = AveragePrecisionMeter(difficult_examples)