FaisalAhemdBijoy

pytorch

Feb 21st, 2021
483
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def validation_epoch_end(self, outputs):
  2.     batch_losses = [x['val_loss']
  3.     for x in outputs] epoch_loss = torch.stack(batch_losses).mean()
  4.     # Combine losses batch_accs = [x['val_acc'] for x in outputs] epoch_acc = torch.stack(batch_accs).mean()
  5.     # Combine accuracies return {'val_loss': epoch_loss.item(), 'val_acc': epoch_acc.item()}
RAW Paste Data