# mmcls.core.mAP¶

mmcls.core.mAP(pred, target)[源代码]

Calculate the mean average precision with respect of classes.

• pred (torch.Tensor | np.ndarray) – The model prediction with shape (N, C), where C is the number of classes.

• target (torch.Tensor | np.ndarray) – The target of each prediction with shape (N, C), where C is the number of classes. 1 stands for positive examples, 0 stands for negative examples and -1 stands for difficult examples.

A single float as mAP value.

float