INNER CODE UNIT · Python
correct_k
adobe/antialiased-cnns · main.py:710
correct_k = correct[:k].reshape(-1).float().sum(0, keepdim=True)
res.append(correct_k.mul_(100.0 / batch_size))
return res
def agreement(output0, output1):
pred0 = output0.argmax(dim=1, keepdim=False)
pred1 = output1.argmax(dim=1, keepdim=False)
agree = pred0.eq(pred1)
agree = 100.*torch.mean(agree.type(torch.FloatTensor).to(output0.device))
return agree
if __name__ == '__main__':
main()