Skip to content

Commit

Permalink
Add softmax before accuracy calculation (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorSusmelj authored Jun 14, 2021
1 parent 885f7a2 commit 63b12f0
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ def training_epoch_end(self, outputs):
def validation_step(self, batch, batch_idx):
x, y, _ = batch
y_hat = self.forward(x)
y_hat = torch.nn.functional.softmax(y_hat, dim=1)
self.accuracy(y_hat, y)
self.log('val_acc', self.accuracy.compute(),
on_epoch=True, prog_bar=True)
Expand Down

0 comments on commit 63b12f0

Please sign in to comment.