pytorch-book icon indicating copy to clipboard operation
pytorch-book copied to clipboard

第六章关于测试结果的说明

Open CescMessi opened this issue 5 years ago • 1 comments

第六章的md文件中对测试的说明为:

测试时,需要计算每个样本属于的概率

而代码中为probability = t.nn.functional.softmax(score,dim=1)[:,0].detach().tolist(),似乎应当是label为0的概率,也就是猫的概率。结果看上去也更像是猫的概率。

CescMessi avatar Apr 18 '19 14:04 CescMessi

对的,就是猫的概率,只要把以上代码改为probability = t.nn.functional.softmax(score,dim=1)[:,1].detach().tolist()就可以啦

GYE19970220 avatar Oct 22 '19 13:10 GYE19970220