pytorch-book
pytorch-book copied to clipboard
第六章关于测试结果的说明
第六章的md文件中对测试的说明为:
测试时,需要计算每个样本属于狗的概率
而代码中为probability = t.nn.functional.softmax(score,dim=1)[:,0].detach().tolist()
,似乎应当是label为0的概率,也就是猫的概率。结果看上去也更像是猫的概率。
对的,就是猫的概率,只要把以上代码改为probability = t.nn.functional.softmax(score,dim=1)[:,1].detach().tolist()
就可以啦