torchnet工具包使用

torchnet工具包使用

  • 1.混淆矩阵(confusion matrix)

举例说明torchnet工具包的使用方法。

1.混淆矩阵(confusion matrix)

"""Computes the confusion matrix of K x K size where K is no of classes

Args:
    predicted (tensor): Can be an N x K tensor of predicted scores obtained from
        the model for N examples and K classes or an N-tensor of
        integer values between 0 and K-1.
    target (tensor): Can be a N-tensor of integer values assumed to be integer
        values between 0 and K-1 or N x K tensor, where targets are
        assumed to be provided as one-hot vectors

"""
```python
import torch
from torchnet

你可能感兴趣的:(深度学习,深度学习,pytorch)