CapsNet-Pytorch icon indicating copy to clipboard operation
CapsNet-Pytorch copied to clipboard

A bug in computing val_acc

Open SamitHuang opened this issue 7 years ago • 0 comments

val_acc is always zeros since "correct" is a tensor with int type. You should "correct" into a float type before computing "correct / len(test_loader.dataset)".

For example, add this in line 127 in capsulenet.py : correct = correct.numpy().astype(float)

SamitHuang avatar Jun 10 '18 07:06 SamitHuang