Rojin:

for data,label in test_loader_X:
    out.append(vae(data))
    k.append(label)



Hi Rojin. So you shouldn’t always use a softmax layer in your model since you will apply it once in your loss function. However, when you are doing your testing, your loss function isn’t used. That’s why you have to apply softmax “manually”. I suggest that you do a predict function in your model that looks something like below. (Could be a typo or something in there, never tested it)
def predict(self, x):
  with torch.no_grad():
    outp = self.forward(x)
    return F.softmax(outp)