Cifar10Dataset#

class Cifar10Dataset(resize=False, data_path='cifar_data')#

Bases: DatasetWrapper

A wrapper to the standard Cifar10 dataset, available at torchvision.datasets.CIFAR10. The current wrapper class supplyes the required transformations and augmentations, and also implements the required DatasetWrapper methods

__init__(resize=False, data_path='cifar_data')#

Methods

__init__([resize, data_path])

get_approximation_set()

Returns data set to be used for range approximation

get_class_labels_dict()

Returns the class_name to index mapping

get_samples_per_class(ds)

Returns the number of samples in each class.

get_test_data()

Returns the test data

get_train_data()

Returns the training data

get_train_pipe_ffcv(args)

Returns the training data as ffcv pipeline

get_val_data()

Returns the validation data

is_imbalanced()

Always returns False - Cifar10 dataset is balanced

get_approximation_set()#

Returns data set to be used for range approximation

get_samples_per_class(ds)#

Returns the number of samples in each class. The Cifar10 dataset has the same number of images in each class.

Params:
  • dataset (VisionDataset): The dataset

Returns:

the number of samples in each class.

Return type:

  • list<int>

get_test_data()#

Returns the test data

get_train_data()#

Returns the training data

get_train_pipe_ffcv(args)#

Returns the training data as ffcv pipeline

Params:
  • args (Arguments): user arguments

Returns:

a dictionary of shape {‘image’: <image_pipeline>, ‘label’: <label_pipeline>} representing the corresponding ffcv pipelines, as explained: https://docs.ffcv.io/making_dataloaders.html#pipelines

Return type:

  • Dictionary

get_val_data()#

Returns the validation data

is_imbalanced()#

Always returns False - Cifar10 dataset is balanced