XifengGuo / CapsNet-Pytorch

Pytorch implementation for NIPS2017 paper `Dynamic Routing Between Capsules`
MIT License
155 stars 36 forks source link

For 7 number of classes #7

Open NidhiKan opened 2 years ago

NidhiKan commented 2 years ago

def test(model, test_loader, args): model.eval() test_loss = 0 correct = 0 for x, y in testloader: y = torch.zeros(y.size(0), 10).scatter(1, y.view(-1, 1), 1.) x, y = Variable(x.cuda(), volatile=True), Variable(y.cuda())

plz check the for loop statements. how the first line of y will be changed for 7 number of classes.