5、深度学习中的排名准确率与网络微调技术

深度学习中的排名准确率与网络微调技术

1. 排名准确率(Ranked Accuracy)

排名准确率是评估模型性能的重要指标,主要包括排名 1 准确率(rank-1 accuracy)和排名 5 准确率(rank-5 accuracy)。

1.1 排名准确率的概念
  • 排名 1 准确率 :指的是真实标签与模型预测概率最大的类别标签相等的次数占比。
  • 排名 5 准确率 :是指真实标签出现在模型预测概率最大的前 5 个类别标签中的次数占比。
1.2 计算排名准确率的代码实现

以下是计算排名 1 和排名 5 准确率的 Python 代码:

# initialize the rank-1 and rank-5 accuracies
rank1 = 0
rank5 = 0

# loop over the predictions and ground-truth labels
for (p, gt) in zip(preds, labels):
    # sort the probabilities by their index in descending
    # order so that the more confident guesses are at the
    # front of the list
    p = np.argsort(p)[::-1]

    # check if the ground-truth l
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值