yamle.third_party.medmnist package#

class yamle.third_party.medmnist.MedMNISTDatasetWrapper(dataset, pad_to_32=True, target_normalization=False)[source]#

Bases: Dataset

This is a wrapper class for MedMNIST dataset.

It enables the padding of the images to 32x32, which is required by the corruptions and might be required by the models. It also does unsqueezing of the target since they are in a numpy array of shape (1,).

Parameters:
  • dataset (Dataset) – The MedMNIST dataset.

  • pad_to_32 (bool) – Whether to pad the images to 32x32. Defaults to True.

  • target_normalization (bool) – Whether to normalize the target to [0, 1]. Defaults to False. This is used for the ordinal regression task.