MNISTData#

class MNISTData[source]#

Class for loading MNIST dataset, inherits from deepchecks.vision.classification_data.ClassificationData.

Implement the necessary methods for the deepchecks.vision.classification_data.ClassificationData interface.

__init__(data_loader: DataLoader, num_classes: Optional[int] = None, label_map: Optional[Dict[int, str]] = None, transform_field: Optional[str] = 'transforms', dataset_name: Optional[str] = None)[source]#
__new__(*args, **kwargs)#

Attributes

MNISTData.classes_indices

Return dict of classes as keys, and list of corresponding indices (in Dataset) of samples that include this class (in the label).

MNISTData.data_dimension

Return how many dimensions the image data have.

MNISTData.data_loader

Return the data loader.

MNISTData.has_images

Return True if the data loader has images.

MNISTData.has_labels

Return True if the data loader has labels.

MNISTData.n_of_samples_per_class

Return a dictionary containing the number of samples per class.

MNISTData.num_classes

Return the number of classes in the dataset.

MNISTData.num_samples

Return the number of samples in the dataset.

MNISTData.original_num_samples

Return the number of samples in the original dataset.

MNISTData.task_type

Return the task type (classification).

MNISTData.transform_field

Return the data loader.

Methods

MNISTData.assert_images_valid()

Assert the image formatter defined is valid.

MNISTData.assert_labels_valid()

Assert the label formatter defined is valid.

MNISTData.batch_of_index(*indices)

Return batch samples of the given batch indices.

MNISTData.batch_to_images(batch)

Convert a batch of mnist data to images.

MNISTData.batch_to_labels(batch)

Convert a batch of mnist data to labels.

MNISTData.copy([n_samples, shuffle, ...])

Create new copy of this object, with the data-loader and dataset also copied, and altered by the given parameters.

MNISTData.from_dataset(data[, batch_size, ...])

Create VisionData instance from a Dataset instance.

MNISTData.get_augmented_dataset(aug)

Return a copy of the vision data object with the augmentation in the start of it.

MNISTData.get_classes(batch_labels)

Get a labels batch and return classes inside it.

MNISTData.get_transform_type()

Return transforms handler created from the transform field.

MNISTData.infer_on_batch(batch, model, device)

Infer on a batch of mnist data.

MNISTData.init_cache()

Initialize the cache of the classes' metadata info.

MNISTData.is_sampled()

Return whether the vision data is running on sample of the data.

MNISTData.label_id_to_name(class_id)

Return the name of the class with the given id.

MNISTData.to_batch(*samples)

Use the defined collate_fn to transform a few data items to batch format.

MNISTData.to_dataset_index(*batch_indices)

Return for the given batch_index the sample index in the dataset object.

MNISTData.update_cache(batch)

Get labels and update the classes' metadata info.

MNISTData.validate_format(model[, device])

Validate the correctness of the data class implementation according to the expected format.

MNISTData.validate_get_classes(batch)

Validate that the get_classes function returns data in the correct format.

MNISTData.validate_image_data(batch)

Validate that the data is in the required format.

MNISTData.validate_inferred_batch_predictions(...)

Validate the inferred predictions from the batch.

MNISTData.validate_label(batch)

Validate the label.

MNISTData.validate_prediction(batch, model, ...)

Validate the prediction.

MNISTData.validate_shared_label(other)

Verify presence of shared labels.