模型开发接口
推理部署接口
API 相关说明
Calculates the classification accuracy given predicted logits and ground-truth labels.
logits (Tensor) – model predictions of shape [batch_size, num_classes], representing the probability (likelyhood) of each class.
Tensor
target (Tensor) – ground-truth labels, 1d tensor of int32.
topk (Union[int, Iterable[int]]) – specifies the topk values, could be an int or tuple of ints. Default: 1
Union
int
Iterable
Union[Tensor, Iterable[Tensor]]
tensor(s) of classification accuracy between 0.0 and 1.0.
previous
megengine.functional.topk
next
megengine.functional.nn.conv1d