updated docs

This commit is contained in:
William Falcon 2019-08-16 10:07:44 -04:00
parent bc401d0f59
commit 50f0de094f
1 changed files with 5 additions and 0 deletions

View File

@ -262,6 +262,11 @@ def validation_step(self, data_batch, batch_nb):
out = self.forward(x)
loss = self.loss(out, x)
# log 6 example images
sample_imgs = x[:6]
grid = torchvision.utils.make_grid(sample_imgs)
self.experiment.add_image('example_images', grid, 0)
# calculate acc
labels_hat = torch.argmax(out, dim=1)
val_acc = torch.sum(y == labels_hat).item() / (len(y) * 1.0)