def post_epoch_callback(self, epoch, visualizer):
    self.val_predictions = torch.cat(self.val_predictions, dim=0)
    predictions = torch.argmax(self.val_predictions, dim=1)
    predictions = torch.flatten(predictions).cpu()
    self.val_labels = torch.cat(self.val_labels, dim=0)
    labels = torch.flatten(self.val_labels).cpu()
    self.val_images = torch.squeeze(torch.cat(self.val_images, dim=0)).cpu()
    val_accuracy = accuracy_score(labels, predictions)
    metrics = OrderedDict()
    metrics['accuracy'] = val_accuracy
    visualizer.plot_current_validation_metrics(epoch, metrics)
    print('Validation accuracy: {0:.3f}'.format(val_accuracy))
    self.val_images = []
    self.val_predictions = []
    self.val_labels = []
def post_epoch_callback(self, epoch, visualizer):
    self.val_predictions = torch.cat(self.val_predictions, dim=0)
    predictions = torch.argmax(self.val_predictions, dim=1)
    predictions = torch.flatten(predictions).cpu()
    self.val_labels = torch.cat(self.val_labels, dim=0)
    labels = torch.flatten(self.val_labels).cpu()
    self.val_images = torch.squeeze(torch.cat(self.val_images, dim=0)).cpu()
    val_accuracy = accuracy_score(labels, predictions)
    metrics = OrderedDict()
    metrics['accuracy'] = val_accuracy
    visualizer.plot_current_validation_metrics(epoch, metrics)
    print('Validation accuracy: {0:.3f}'.format(val_accuracy))
    self.val_images = []
    self.val_predictions = []
    self.val_labels = []