visualize_classification_data

hybrid_learning.datasets.data_visualization.visualize_classification_data(dataset, save_as=None, max_num_samples=5, skip_none=True, shuffle=False)[source]

Visualize a dataset yielding tuples of the form (input, target_class_identifier). The input must be an image as torch.Tensor.

Parameters
  • dataset (BaseDataset) – the dataset to visualize

  • save_as (Optional[str]) – file path to save the image under using matplotlib.pyplot.savefig(); not saved if None

  • max_num_samples (int) – the maximum number of samples to show for each dataset

  • skip_none (bool) – whether to ignore samples where a None value in input or target is encountered

  • shuffle (bool) – whether to randomly select samples from the dataset