acc=total_correct/total_num

How does this return the predicted value？

acc=total_correct/total_num

How does this return the predicted value？

This line of code does not return the predicted value, but calculates the accuracy.

Could you explain your use case and issue a bit?

x=x.view(x.size(0),3*64*64)

out=autoencoder(x)

pred=out.argmax(dim=1)

correct=pred.eq(y).sum().float().item()

total_correct+=correct

total_num=len(test_loader.dataset)

acc=total_correct/total_num

I still use the onehot encoding to return the predicted value, but this is wrong, because I am using an autoencoder, so I don’t know how to return the predicted value.

x=x.view(x.size(0),3 *64* 64)

out=autoencoder(x)

pred=out.argmax(dim=1)

correct=pred.eq(y).sum().float().item()

total_correct+=correct

total_num=len(test_loader.dataset)

acc=total_correct/total_num

I still use the onehot encoding to return the predicted value, but this is wrong, because I am using an autoencoder, so I don’t know how to return the predicted value.

If you would like to reproduce the input, `out`

should already be the prediction.

I’m not familiar with your use case, so could you explain, what kind of input you are trying to reconstruct?

Currently, if seems as if you have some labels in your input, as you are using `argmax`

on your output.